/*
 * Combat Dashboard — public/combat.css
 *
 * Page layout for combat.html. Reuses the shared CSS custom properties from
 * style.css (light + dark) and a few shared classes (.sans, .section-head,
 * .section-note, footer). Layout mirrors the dashboard's card style.
 */

.combat-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 28px 72px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.combat-masthead { display: flex; flex-direction: column; gap: 10px; }
.combat-masthead h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* WIP banner — top of page (red on purpose, not the site accent) */
.combat-wip-banner {
  --wip: #c2382e;
  --wip-ink: #a02b22;
  --wip-wash: rgba(194, 56, 46, 0.10);
  background: var(--wip-wash);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--wip);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.combat-wip-banner strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wip-ink);
}
@media (prefers-color-scheme: dark) {
  .combat-wip-banner {
    --wip: #e0564c;
    --wip-ink: #ef8b83;
    --wip-wash: rgba(224, 86, 76, 0.14);
  }
}
.combat-wip-banner p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------- teams */
.combat-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .combat-teams { grid-template-columns: 1fr; }
  .vs-divider { display: none; }
}

.team-card {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-card-alpha { border-top: 3px solid var(--accent); }
.team-card-omega { border-top: 3px solid #3b6fd4; }

.team-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
.team-card-alpha .team-name { color: var(--accent-ink); }
.team-card-omega .team-name { color: #3b6fd4; }
.team-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.team-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.team-power {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  cursor: help;
}
.team-card-alpha .team-power { color: var(--accent-ink); }
.team-card-omega .team-power { color: #3b6fd4; }

.team-stats { display: flex; flex-direction: column; gap: 2px; }
.team-stats::before {
  content: "Team combat stats (total)";
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.combat-team-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 560px) { .combat-team-stats { grid-template-columns: repeat(4, 1fr); } }
.combat-team-stat {
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.combat-team-stat-val { font-size: 16px; font-weight: 700; }
.combat-team-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* team roster */
.team-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.combat-member {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 8px 10px;
  border-radius: 8px;
}
.combat-member:hover { background: var(--surface-alt); }
.combat-member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combat-member-name:hover { color: var(--accent-ink); text-decoration: underline; }
.combat-member-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.combat-member-auras { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.combat-aura-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  cursor: help;
}
.combat-aura-chip.dim { opacity: 0.55; }
.combat-aura-name { white-space: nowrap; }
.combat-aura-eff { color: var(--accent-ink); }
.team-card-omega .combat-aura-eff { color: #3b6fd4; }
/* The single active (strongest) aura a member fields. */
.combat-aura-chip.active-aura {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-primary);
}
.team-card-alpha .combat-aura-chip.active-aura { border-color: var(--accent); }
.team-card-omega .combat-aura-chip.active-aura { border-color: #3b6fd4; }

.combat-aura-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.combat-aura-icon-img { width: 16px; height: 16px; object-fit: contain; }

.combat-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 8px 10px;
}

/* vs divider */
.vs-divider {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vs-divider span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 8px 12px;
}

/* Warning pill appended to the sign-up board note when the game's item table
   isn't cached (gear can't be priced → members fall back to ≈ estimates). */
.legend-warn {
  display: block;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--warn, #b35900);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ------------------------------------------------- two-trial sign-up board */
.signup-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) { .signup-board { grid-template-columns: 1fr; } }

.signup-team {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px 12px;
  box-shadow: var(--shadow);
}
.signup-head {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: help;
}
.signup-note {
  margin: 2px 0 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.signup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.signup-list-bench { margin-top: 8px; }

/* Row: rank | name | role chip | tank-balance chip (dedicated tanks on a non-tank lane) | aura chip (seated runners only) | value | data marker */
.signup-row {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr) auto auto auto minmax(0, max-content) 1.2em;
  align-items: center;
  column-gap: 7px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.signup-row:hover { background: var(--surface-alt); border-color: var(--border-soft); }
.signup-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.signup-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signup-name:hover { color: var(--accent-ink); text-decoration: underline; }
.signup-val {
  grid-column: 6; /* pinned: rows vary between role/tank/aura chips, value + marker keep their columns */
  justify-self: end;
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signup-data { font-size: 11px; font-weight: 700; cursor: help; grid-column: 7; }
.signup-data-exact { color: var(--accent-ink); }
.signup-data-gear { color: var(--text-secondary); }
.signup-data-est { color: var(--text-muted); }

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: help;
}
.role-any_role { color: var(--text-muted); }
.role-damage_dealer {
  color: #b03a2e;
  background: rgba(211, 84, 58, 0.12);
  border-color: rgba(211, 84, 58, 0.35);
}
.role-support {
  color: #1e7d4f;
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.35);
}
.role-tank {
  color: #20558f;
  background: rgba(41, 128, 185, 0.12);
  border-color: rgba(41, 128, 185, 0.35);
}
/* Secondary badge: the member's suggested slot is the OTHER chip; this one
   says they still count for this side's tank balance. */
.signup-tank-chip { opacity: 0.85; font-weight: 600; }

.signup-bench { grid-column: 1 / -1; }
.signup-bench-summary {
  list-style: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.signup-bench-summary::-webkit-details-marker { display: none; }
.signup-bench-summary::before { content: "\25B6"; font-size: 10px; margin-right: 8px; color: var(--text-muted); }
details[open] > .signup-bench-summary::before { content: "\25BC"; }
.signup-bench-summary:hover { color: var(--accent-ink); text-decoration: underline; }

/* ------------------------------------------------------------ combat sim
   Per-trial simulation cards (built by combat.js). One card per this-week
   encounter: a Simulate button, a progress strip while the in-browser
   worker runs, then the verdict - boss bar, stats, per-member damage. */
.sim-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) { .sim-board { grid-template-columns: 1fr; } }

.sim-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sim-card.side-omega { border-left-color: #3b6fd4; }

.sim-head {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sim-boss {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.sim-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  cursor: help;
}
.sim-pill.warn { color: var(--warn, #b35900); border-color: var(--border); }

.sim-run { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.sim-card.side-omega .sim-btn { border-color: #3b6fd4; background: #3b6fd4; }
.sim-btn:hover:not(:disabled) { filter: brightness(1.08); }
.sim-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sim-status { font-size: 12px; color: var(--text-secondary); }
.sim-status.err { color: #b3261e; white-space: pre-wrap; }

.sim-progress {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: none;
}
.sim-progress > div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s linear;
}
.sim-card.side-omega .sim-progress > div { background: #3b6fd4; }

.sim-results { display: none; flex-direction: column; gap: 10px; }
.sim-verdict { font-size: 13.5px; font-weight: 700; }
.sim-verdict .v-ok { color: #1a7f37; }
.sim-verdict .v-warn { color: var(--warn, #b35900); }

.sim-bossbar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.sim-bossbar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5d1515, #b3261e);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.sim-bossbar-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
}

.sim-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 6px;
}
.sim-stat {
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sim-stat-val { font-size: 14px; font-weight: 700; }
.sim-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sim-damage {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}
.sim-damage-row {
  display: grid;
  grid-template-columns: 1.5em minmax(0, 1fr) 6em 5em 4.5em;
  gap: 8px;
  padding: 3px 9px;
  align-items: center;
}
.sim-damage-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.sim-damage-row + .sim-damage-row { border-top: 1px solid var(--border-soft); }
.sim-dmg-name {
  font-size: 12px;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-dmg-name:hover { color: var(--accent-ink); text-decoration: underline; }
.sim-card.side-omega .sim-dmg-name:hover { color: #3b6fd4; }
.sim-dmg-bar { height: 7px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.sim-dmg-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
}
.sim-card.side-omega .sim-dmg-bar > span { background: #3b6fd4; }
.sim-dmg-nums {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sim-details { font-size: 11.5px; color: var(--text-muted); }
.sim-details summary { cursor: pointer; }

/* Per-player loadout breakdown in the sim results. */
.sim-loadouts {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-alt);
}
.sim-loadouts summary { cursor: pointer; font-size: 11.5px; color: var(--text-secondary); }
.sim-loadouts summary:hover { color: var(--accent-ink); text-decoration: underline; }
.sim-loadout-list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.sim-loadout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-top: 1px solid var(--border-soft);
}
.sim-loadout-row .sim-dmg-name { min-width: 110px; max-width: 170px; font-weight: 600; }
.sim-chip {
  font-size: 10.5px;
  line-height: 1.6;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.sim-chip-warn { color: #b35900; border-color: #d9a066; background: rgba(255, 145, 60, 0.08); }
.sim-chip-dim { opacity: 0.6; }

/* The name-hover loadout tip (.sim-loadout-tip / .sim-tip-*) is styled in
   the shared public/sim-tip.css, which combat.html links — it was mirrored
   1:1 here before both pages consolidated onto that file. */

/* ---- the trial tier ladder ------------------------------------------- */
.sim-tiers {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}
.sim-tier-row {
  display: grid;
  grid-template-columns: 5em 5em 5.5em minmax(0, 1fr);
  gap: 8px;
  padding: 4px 10px;
  align-items: center;
  font-size: 12px;
}
.sim-tier-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.sim-tier-row + .sim-tier-row { border-top: 1px solid var(--border-soft); }
.sim-tier-num { font-weight: 700; }
.sim-tier-final { background: var(--surface-alt); }
.sim-tier-ok { color: #1a7f37; }
.sim-tier-warn { color: var(--warn, #b35900); }

