/* Expedition 33 build planner */

/* the per-character palettes come from /e33/theme.css, generated from the
   official character portraits (assets/e33/character_colors.json) */

.char-tabs { margin-bottom: 16px; }
.char-tabs button {
  font-size: 1.15rem;
  font-variant: small-caps;
  letter-spacing: .06em;
  padding: 10px;
}
.char-tabs button .dirty, .slot-tabs button .dirty { color: var(--warn); margin-left: 4px; }
.slot-tabs { margin: -8px 0 16px; max-width: 640px; }
.slot-tabs button { padding: 6px 10px; letter-spacing: .03em; }
.slot-tabs button small { display: block; font-size: .72rem; color: var(--text-dim); letter-spacing: 0; }

.builder {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.builder-right { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border-radius: 10px; }
@media (max-width: 960px) {
  .builder { grid-template-columns: 1fr; }
  .builder-right { position: static; max-height: none; }
}

/* ---------- weapon ---------- */

.weapon-row .cselect { display: block; width: 100%; }
.weapon-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 14px;
  margin-top: 12px;
  align-items: start;
}
.weapon-card:empty { display: none; }
.weapon-card img { width: 56px; height: 120px; object-fit: contain; grid-row: span 3; }
.weapon-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.weapon-passives { margin: 6px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.weapon-passives li { display: flex; gap: 8px; padding: 3px 0; }
.weapon-passives .lvl {
  flex-shrink: 0;
  min-width: 46px;
  color: var(--gold);
  font-variant: small-caps;
}
.weapon-link { grid-column: 2; font-size: .82rem; color: var(--text-dim); }
.weapon-where { grid-column: 2; margin-top: 4px; }
.where li.note b { color: var(--gold); font-weight: 400; font-style: italic; }
.badge.scaling { text-transform: none; letter-spacing: .02em; font-size: .78rem; }
.grade { font-weight: 600; font-variant: normal; color: var(--gold); }   /* every grade in the accent colour */
/* on the attribute tiles the whole tile is already coloured: the grade just takes its colour */
.attribute .grade { color: inherit; }

.attributes { display: flex; flex-wrap: wrap; gap: 8px; }
.attribute {
  flex: 1 1 90px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  background: none;
  color: var(--text-dim);
}
.attribute .val { display: block; font-size: 1.4rem; color: inherit; }
.attribute.max { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) var(--alpha-faint), transparent); }
.attribute.choosable { cursor: pointer; border-style: dashed; }
.attribute.choosable:hover { color: var(--text); border-color: var(--gold); }
.attribute:disabled { cursor: default; }
.attribute.free { cursor: default; display: flex; flex-direction: column; align-items: center; }
.attribute .val-input {
  width: 4.2em;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  font-size: 1.3rem;
  text-align: center;
  padding: 1px 2px;
}
.attribute .val-input:focus { outline: none; border-color: var(--gold); }
#attributes-hint b { color: var(--gold); font-weight: 600; }
#attributes-hint b.over { color: var(--bad); }

/* small on/off switch */
.attributes-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-dim); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 30px; height: 16px; border-radius: 999px; background: color-mix(in srgb, var(--border) 80%, black);
  border: 1px solid var(--border); transition: background .15s ease; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-dim); transition: transform .15s ease, background .15s ease; }
.switch input:checked + .track { background: color-mix(in srgb, var(--gold) var(--alpha-soft), transparent); border-color: var(--gold); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--gold); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) var(--alpha-soft), transparent); }
.switch:hover { color: var(--text); }

/* ---------- picto browser ---------- */

.picto-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.picto-toolbar input[type="search"] { flex: 1 1 200px; }
.picto-toolbar .segmented button { padding: 6px 12px; white-space: nowrap; }
.tag-active { color: var(--gold); font-weight: 600; }
.tag-lumina { color: color-mix(in srgb, var(--accent) 60%, white); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  padding: 3px 11px;
  font-size: .84rem;
}
.chip .n { opacity: .6; font-size: .78em; margin-left: 3px; }
.chip:hover { color: var(--text); border-color: var(--gold); }
.chip.on { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) var(--alpha-faint), transparent); }
.count { margin: 4px 0 10px; }

.picto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.picto {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bg-card) 80%, black);
  transition: border-color .15s, box-shadow .15s;
}
.picto.is-active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 18px color-mix(in srgb, var(--gold) var(--alpha-faint), transparent);
}
.picto.is-lumina:not(.is-active) { border-color: color-mix(in srgb, var(--accent) 80%, white 10%); border-style: dashed; }
.picto.is-nice:not(.is-active) { border-color: color-mix(in srgb, var(--text-dim) 60%, transparent); border-style: dotted; }
.picto-actions .nice.on { color: var(--text); background: color-mix(in srgb, var(--text-dim) 30%, transparent); border-color: var(--text-dim); }
.picto-head { display: flex; align-items: center; gap: 10px; }
.picto-head img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.picto-head .noicon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0; }
.picto-name { flex: 1; line-height: 1.2; }
.picto-name .new { color: var(--warn); font-size: .72rem; margin-left: 4px; letter-spacing: .05em; }
.cost {
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .85rem;
  border: 1px solid color-mix(in srgb, var(--gold) var(--alpha-soft), var(--border));
  color: var(--gold);
}
.cost::after { content: " LP"; font-size: .7em; opacity: .7; }
.picto-effect { font-size: .88rem; line-height: 1.4; color: var(--text); margin: 0; }
.picto-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; color: var(--text-dim); }
.picto-stats .crit { color: var(--crit); font-weight: 600; }
.unknown { color: var(--text-dim); font-style: italic; }
.picto-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.picto-cats .badge { font-size: .62rem; padding: 1px 6px; }
.picto-cats .badge.drawback { color: var(--warn); border-color: color-mix(in srgb, var(--warn) var(--alpha-mid), transparent); }
.picto-actions { display: flex; gap: 6px; margin-top: auto; align-items: center; }
.picto-actions .mini-button { flex: 1; padding: 4px 6px; }
.picto-actions .equip.on { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.picto-actions .lumina.on {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) var(--alpha-mid), transparent);
  border-color: var(--accent);
}
.taken { font-size: .75rem; color: var(--warn); }

/* game progression: when and where a Picto can be had */
.picto-progress { display: flex; flex-direction: column; gap: 4px; }
.progress-bar { display: flex; gap: 2px; height: 6px; }
.progress-bar .seg { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--border) 70%, black); }
.progress-bar .seg.act-start { margin-left: 4px; }
.progress-bar .seg.on { background: color-mix(in srgb, var(--gold) 45%, var(--bg-card)); }
.progress-bar .seg.here { background: var(--gold); }
.where { font-size: .78rem; color: var(--text-dim); }
.where summary { cursor: pointer; list-style: none; }
.where summary::-webkit-details-marker { display: none; }
.where summary .unlock { color: var(--text); }
.where summary .approx { color: var(--warn); }
.where summary:hover .where-toggle { color: var(--gold); }
.where ul { margin: 4px 0 0; padding-left: 16px; }
.where li { margin: 2px 0; line-height: 1.35; }
.where li b { color: var(--text); font-weight: 600; }
.where .how { color: var(--text-dim); }
.cselect[data-for="picto-progress"] { max-width: 260px; }

/* ---------- skills ---------- */

.skill-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.skill-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: none;
  color: var(--text-dim);
  text-align: left;
  font-size: .9rem;
}
.skill-slot.filled { border-style: solid; border-color: var(--gold); color: var(--text); }
.skill-slot.filled:hover { border-color: var(--bad); }
.skill-slot img { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; }
.skill-search { width: 100%; margin-bottom: 8px; }
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.skill {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 2px 10px;
  align-items: start;
  align-content: start;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: none;
  color: var(--text);
}
.skill:hover { border-color: var(--gold); }
.skill.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) var(--alpha-faint), transparent); }
.skill > img { width: 40px; height: 40px; border-radius: 6px; grid-row: span 2; }
.skill .ap { color: var(--gold); font-size: .85rem; white-space: nowrap; }
.skill .effect { grid-column: 2 / 4; font-size: .8rem; color: var(--text-dim); line-height: 1.35; white-space: pre-line; }
.skill .mechanic { grid-column: 2 / 4; font-size: .8rem; color: var(--text); display: flex; align-items: center; gap: 2px; }
.inline-icon { width: 18px; height: 18px; vertical-align: -4px; margin: 0 1px; object-fit: contain; }
.skill .mechanic .inline-icon { width: 20px; height: 20px; }
.skill .damage { grid-column: 2 / 4; display: flex; flex-direction: column; gap: 3px; font-size: .8rem; margin-top: 3px;
  padding-top: 4px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.skill .damage b { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.skill .damage .variant, .skill .damage .cond { color: var(--text-dim); }
.skill .dmg-meta { display: block; color: var(--text-dim); font-size: .74rem; }
.skill .dmg-notes { display: block; color: var(--text-dim); font-size: .74rem; font-style: italic; }
.skill-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.skill-toolbar .skill-search { flex: 1; margin: 0; }
.damage-reference { font-size: .8rem; color: var(--text); margin: 0 0 8px; }
.damage-reference b { color: var(--gold); font-weight: 600; }
.damage-reference:empty { display: none; }

/* ---------- summary ---------- */

.active-slots { display: grid; gap: 6px; }
.active-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 44px;
  color: var(--text-dim);
  font-size: .92rem;
}
.active-slot.filled { border-style: solid; border-color: var(--gold); color: var(--text); }
.active-slot img { width: 28px; height: 28px; }
.active-slot .grow { flex: 1; min-width: 0; }
.active-slot .sub { display: block; font-size: .78rem; color: var(--text-dim); }
.active-slot .x { background: none; border: none; color: var(--text-dim); font-size: 1.1rem; padding: 0 4px; }
.active-slot .x:hover { color: var(--bad); }

.crit-block { margin: 14px 0 6px; }
.crit-head { display: flex; justify-content: space-between; align-items: baseline; font-variant: small-caps; letter-spacing: .04em; }
.crit-value { font-size: 1.5rem; }
.crit-value.ok { color: var(--good); }
.crit-value.low { color: var(--crit); }
.crit-bar {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 60%, black);
  margin: 6px 0 10px;
}
.crit-bar span { display: block; height: 100%; transition: width .25s ease; }
#crit-base { background: color-mix(in srgb, var(--text-dim) 70%, transparent); }
#crit-pictos { background: var(--crit); }
#crit-cond { background: color-mix(in srgb, var(--crit) 45%, var(--warn)); opacity: .8; }
.breakdown { list-style: none; padding: 0; margin: 0 0 8px; font-size: .84rem; color: var(--text-dim); }
.breakdown li { display: flex; justify-content: space-between; padding: 1px 0; }
.breakdown li b { color: var(--text); font-weight: 400; font-variant-numeric: tabular-nums; }
.breakdown li.sum { border-top: 1px solid var(--border); margin-top: 3px; padding-top: 3px; color: var(--text); }
.conditions { margin: 4px 0 8px; }
.conditions .check { font-size: .84rem; }
.conditions .check b { color: var(--crit); font-weight: 600; }
.speed-value { color: var(--gold); }
.flag { font-size: .72rem; letter-spacing: .04em; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
.small-hint { font-size: .8rem; margin: 4px 0; }
.small-hint a { color: var(--gold); }
.attribute .gives { display: block; font-size: .72rem; margin-top: 2px; opacity: .85; }

/* ---------- team view ---------- */

.team-view .panel + .panel { margin-top: 16px; }
.team-table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.team-table th { text-align: left; font-weight: 400; font-variant: small-caps; letter-spacing: .04em; color: var(--gold); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.team-table td { padding: 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: top; }
.team-table tr.out td:not(:first-child) { opacity: .45; }
.team-table .char-link { background: none; border: none; color: var(--text); padding: 0; font-size: 1.05rem; font-variant: small-caps; letter-spacing: .05em; }
.team-table .char-link:hover { color: var(--gold); }
.team-table .pictos span { display: inline-block; margin: 0 6px 2px 0; }
.team-table .pictos .conflict { color: var(--bad); }
.team-table .ok { color: var(--good); }
.team-table .low { color: var(--crit); }
.team-table .sub { display: block; font-size: .78rem; color: var(--text-dim); }
.team-table input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 14px; }
.team-actions .cta { width: auto; padding: 10px 22px; margin: 0; }
.team-result { margin-top: 14px; }
.team-result .summary-line { margin: 0 0 10px; }
.team-result .summary-line.ok { color: var(--good); }
.team-result .summary-line.low { color: var(--warn); }
.team-result .team-actions { margin-top: 10px; }
.changed { color: var(--gold); }
.turn-order { margin: 0; padding-left: 1.6em; }
.turn-order li { padding: 5px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.turn-order li .spd { float: right; color: var(--gold); font-variant-numeric: tabular-nums; }
.team-save { max-width: 420px; }

.field { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-size: .9rem; }
.field small { color: var(--text-dim); }
.field .num { width: 84px; text-align: right; }

.stat-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: .92rem; }
.stat-table td { padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.stat-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .88rem; color: var(--text-dim); }
.check input { accent-color: var(--gold); width: 15px; height: 15px; flex-shrink: 0; }
.check small { display: block; font-size: .8rem; opacity: .8; }

.suggestions { display: grid; gap: 8px; margin: 8px 0 4px; }
.suggestion {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .88rem;
}
.suggestion.reaches { border-color: color-mix(in srgb, var(--good) 60%, var(--border)); }
.suggestion .names { color: var(--text); }
.suggestion .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-dim); margin: 4px 0 6px; font-size: .82rem; }
.suggestion .meta .crit { color: var(--crit); }
.suggestion .meta .saved { color: var(--good); }
.suggestion-note { font-size: .85rem; color: var(--text-dim); margin: 0; }

.lumina-meter { float: right; font-variant: normal; font-size: .95rem; color: var(--text); }
.lumina-meter.over { color: var(--bad); }
.lumina-budget-bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--border) 60%, black); overflow: hidden; }
.lumina-budget-bar { display: flex; }
.lumina-budget-bar span { display: block; height: 100%; background: var(--gold); transition: width .25s ease; }
.lumina-budget-bar #lumina-fill-nice { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.lumina-meter .nice-cost { color: var(--text-dim); }
.lumina-meter.over-nice .nice-cost { color: var(--warn); }
.lumina-list li.group { border: none; padding-top: 8px; font-variant: small-caps; letter-spacing: .04em; color: var(--gold); justify-content: space-between; }
.lumina-list li.group small { color: var(--text-dim); font-variant: normal; }
.lumina-list li.nice .grow { color: var(--text-dim); }
.flag.nice { border-style: dashed; opacity: .8; }
.breakdown li.nice { color: var(--text-dim); border-top-style: dashed; }
.progress-select { max-width: 190px; }
.lumina-budget-bar.over span { background: var(--bad); }
.lumina-list { list-style: none; padding: 0; margin: 8px 0; font-size: .88rem; }
.lumina-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.lumina-list .grow { flex: 1; min-width: 0; cursor: help; }
.lumina-list .lp { color: var(--gold); font-variant-numeric: tabular-nums; }
.lumina-list .free { color: var(--good); font-size: .78rem; }
.lumina-list .x { background: none; border: none; color: var(--text-dim); padding: 0 4px; }
.lumina-list .x:hover { color: var(--bad); }
.lumina-list .empty { color: var(--text-dim); border: none; }

.notes { width: 100%; resize: vertical; }
.save-row { display: flex; gap: 8px; margin-top: 12px; }
.save-row .cta { flex: 1; margin: 0; }
#save-status { margin: 8px 0 0; min-height: 1.2em; }
#save-status.ok { color: var(--good); }
#save-status.err { color: var(--bad); }

/* ---------- tooltip ---------- */

.tooltip {
  position: fixed;
  z-index: 50;
  max-width: 340px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--bg-card) 92%, black);
  font-size: .86rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  white-space: pre-line;
}
.tooltip b { color: var(--gold); font-weight: 600; }

/* ---------- build links ---------- */

.link-row { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.link-out { width: 100%; font-size: .78rem; color: var(--text-dim); }
.team-save { max-width: 640px; }
.team-save .ghost-button { white-space: nowrap; }
#team-link-out { max-width: 640px; margin-top: 8px; }
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) var(--alpha-mid), transparent);
  background: color-mix(in srgb, var(--gold) var(--alpha-faint), transparent);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: .92rem;
}
.notice .grow { flex: 1; min-width: 240px; }
