/* Expedition 33 – flow diagrams of rotations (builds pages and the planner's Team tab).
   Nodes come from common.js: turn starts, skills (cost, mechanic and AP before -> after), loops. */

.flow-icon { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.flow-icon.text { display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; font-size: .65rem; }
.gain .flow-icon { width: 16px; height: 16px; }
.gain.buff { padding: 0 4px; }
.gain.other { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.turn-notes { font-size: .74rem; color: var(--text-dim); font-style: italic; }
.turn-node.skipped .turn-title { color: var(--text-dim); }

/* the flow: opening column on top, the variants side by side below it */
.flow { --line: color-mix(in srgb, var(--gold) 45%, var(--border)); --col: 330px;
  display: flex; flex-direction: column; align-items: center; overflow-x: auto; padding-bottom: 6px; }
.flow-col { display: flex; flex-direction: column; align-items: stretch; width: min(100%, var(--col)); }
.variants { display: grid; grid-template-columns: repeat(var(--n), minmax(280px, var(--col)));
  gap: 0 22px; justify-content: center; position: relative; min-width: min-content; }
.variants .flow-col { width: auto; }
/* branch: a line across the column centres, a stem down into each column */
.variants.branched { padding-top: 22px; margin-top: 0; }
.variants.branched::before { content: ""; position: absolute; top: 0;
  left: calc(100% / var(--n) / 2); right: calc(100% / var(--n) / 2); border-top: 2px solid var(--line); }
.variants.branched > .flow-col::before { content: ""; align-self: center; height: 22px; margin-top: -22px;
  border-left: 2px solid var(--line); }
.opening::after { content: ""; align-self: center; height: 18px; border-left: 2px solid var(--line); }

.variant-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-card)); }
.variant-head b { color: var(--gold); font-variant: small-caps; letter-spacing: .04em; font-size: 1.05rem; }
.variant-head span { font-size: .78rem; color: var(--text-dim); line-height: 1.3; }

/* a turn start between two skills: a stem with what the turn brings */
.turn-node { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 8px;
  position: relative; text-align: center; font-size: .8rem; }
.turn-node::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid var(--line); z-index: 0; }
.turn-node > * { position: relative; z-index: 1; background: var(--bg-card); padding: 0 6px; }
.turn-title { color: var(--text); font-variant: small-caps; letter-spacing: .05em; }
.turn-title b { color: var(--gold); font-weight: 600; }
.turn-gains { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.gain { display: inline-flex; align-items: center; gap: 2px; font-size: .74rem; padding: 1px 7px; border-radius: 999px;
  color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.gain.lost { color: var(--text-dim); border-color: var(--border); }
.gain.capped { color: color-mix(in srgb, var(--good) 60%, var(--text-dim)); }
.turn-node.replay .turn-title b { color: var(--accent); }

/* a skill: name and cost, Stains before -> after, AP before -> after */
.skill-node { border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px 10px;
  background: color-mix(in srgb, var(--gold) 4%, var(--bg-card)); display: flex; flex-direction: column; gap: 6px; }
.skill-node.short { border-color: color-mix(in srgb, var(--warn) 70%, var(--border)); }
.skill-node.failed { border-color: var(--bad); }
.node-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.node-icon { width: 34px; height: 34px; border-radius: 6px; }
.node-name { font-size: 1.02rem; font-weight: 600; }
.node-cost { color: var(--gold); font-weight: 600; white-space: nowrap; }
.node-cost s { color: var(--text-dim); font-weight: 400; }
.empowered { align-self: flex-start; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.empowered.on { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.node-row { display: grid; grid-template-columns: 50px auto auto 1fr; gap: 8px; align-items: center; }
.row-label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.stains { display: inline-flex; gap: 2px; min-height: 24px; align-items: center; }
.stain { width: 24px; height: 24px; object-fit: contain; }
.stain.text { display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; font-size: .7rem; }
.stain.consumed { opacity: .3; filter: grayscale(1); }
.stain.gained { border-radius: 50%; box-shadow: 0 0 0 2px var(--good); }
.no-stains { font-size: .78rem; color: var(--text-dim); font-style: italic; }
.arrow { color: var(--text-dim); }
.ap-numbers { font-variant-numeric: tabular-nums; }
.ap-numbers b { color: var(--gold); }
.ap-meter { display: inline-flex; gap: 2px; justify-self: end; }
.ap-meter .pip { width: 8px; height: 14px; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); }
.ap-meter .pip.on { background: var(--gold); border-color: var(--gold); }
.node-gains { display: flex; flex-wrap: wrap; gap: 4px; }
.node-note { font-size: .75rem; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.node-note .stain { width: 18px; height: 18px; }
.node-error { margin: 0; font-size: .82rem; color: var(--warn); }
.skill-node.failed .node-error { color: var(--bad); }
.node-damage { font-size: .8rem; color: var(--text-dim); }
.node-damage b { color: var(--text); }

/* the end of a variant: back to the top, and whether it pays for itself */
.loop-node { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.loop-node p { margin: 4px 0 0; font-size: .82rem; }
.loop-back { color: var(--gold); font-variant: small-caps; letter-spacing: .05em; }
.loop-good { color: var(--good); font-weight: 600; }
.loop-bad { color: var(--warn); font-weight: 600; }
.loop-detail b { color: var(--gold); }


/* ---------- the planner's Team tab: example rounds ---------- */

.rounds-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.rounds-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.segmented.small button { padding: 4px 12px; font-size: .85rem; }
.order-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.order-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; }
.mini-label { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-dim); }
.mini-select, .mini-input { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 2px 4px; font: inherit; font-size: .8rem; }
.mini-input { width: 3.2em; }
.warn-text { color: var(--warn); }
.rounds-grid-wrap { overflow: visible; }   /* no clipping: the themed dropdowns open below their cell */
.rounds-grid { border-collapse: collapse; width: 100%; }
.rounds-grid th, .rounds-grid td { border-bottom: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.rounds-grid th .char-link { display: block; margin-bottom: 4px; }
.member-settings { display: flex; flex-wrap: wrap; gap: 4px 10px; font-weight: 400; }
.round-head { white-space: nowrap; color: var(--gold); }
.loop-row .round-head, .lane-round.loop-row { color: var(--accent); }
.loop-mark { color: var(--accent); }
.round-cell { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 200px; }
.action-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; border: 1px solid var(--border);
  border-radius: 8px; font-size: .82rem; background: color-mix(in srgb, var(--gold) 6%, var(--bg-card)); }
.action-icon { width: 22px; height: 22px; border-radius: 4px; }
.chip-x { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0 3px; font-size: .9rem; }
.chip-x:hover { color: var(--bad); }
.add-action { color: var(--text-dim); }

.rounds-summary p { margin: 4px 0; }
.verdict { font-size: .9rem; margin: 2px 0; }
.verdict.good b { color: var(--good); }
.verdict.bad b { color: var(--warn); }
.lumina-pill { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: .8rem; }
.lumina-pill.add { color: var(--good); border-color: var(--good); }
.lumina-pill.drop { color: var(--text-dim); text-decoration: line-through; }

/* lanes: one column per member plus the enemies, rounds top to bottom */
.lanes-wrap { overflow-x: auto; margin-top: 12px; }
.lanes { display: grid; grid-template-columns: repeat(calc(var(--cols) - 1), minmax(270px, 1fr)) minmax(170px, .6fr);
  gap: 0 16px; min-width: min-content; --line: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.lane-head { position: sticky; top: 0; z-index: 2; background: var(--bg-card); padding: 6px 0; text-align: center;
  font-variant: small-caps; letter-spacing: .05em; color: var(--gold); border-bottom: 2px solid var(--line); }
.lane-round { grid-column: 1 / -1; margin-top: 14px; padding: 4px 8px; border-left: 3px solid var(--gold);
  font-variant: small-caps; letter-spacing: .04em; color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, transparent); }
.lane-cell { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.enemy-cell { border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-top: 8px; font-size: .82rem; }
.enemy-cell.short { border-color: var(--warn); }
.enemy-count { display: block; margin-bottom: 4px; color: var(--gold); }
.enemy-cell.short .enemy-count { color: var(--warn); }
.enemy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.enemy-row .flow-icon { width: 18px; height: 18px; }
.cselect.mini-select { display: inline-block; border: none; padding: 0; background: none; }
.cselect.mini-select .cselect-button { padding: 2px 22px 2px 6px; font-size: .8rem; min-height: 0; }
.segmented.small button { white-space: nowrap; }
