/* The team builder's panels, the buffs and debuffs page, the timeline, keepsakes and the star animation. Loaded in the order base, roster, fighter, team, companions, panels, pages, insights: a later file wins over an earlier one at equal weight. */
/* what the selected formation gives the team */
.form-bonus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; font-size: 15px; }
.form-bonus[hidden] { display: none; }
.form-chip { padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); font: 700 14px var(--cond); letter-spacing: .06em; color: var(--tag); }
.form-type { font-weight: 500; opacity: .75; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }

.pcard-more summary { cursor: pointer; font: 600 12px var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pcard-more[open] summary { margin-bottom: 6px; }
@media (max-width: 640px) {
  .pcard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pcard:has(details[open]) { grid-column: 1 / -1; }
  .pcard-body { padding: 6px 7px 8px; }
  .pcard-name { font-size: 14px; }
}
.pick-bar { display: flex; gap: 8px; align-items: center; }
.pick-bar .search { flex: 1 1 auto; }
.pick-filters { display: flex; flex-direction: column; gap: 12px; padding: 12px; margin-bottom: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 50vh; overflow-y: auto; }
.pick-active { margin: 0; }
.pick-active:empty { display: none; }

/* once the picker no longer fits beside the team, it goes right under the formation instead of after everything */
@media (max-width: 1127px) {
  .teams-main { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 20px; }
  .teams-col { display: contents; }
  .teams-col > * { order: 3; }
  .teams-col > :first-child { order: 1; }
  .teams-picker { order: 2; position: static; flex: none; }
}

/* row effects */
.row-notes { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.row-notes li { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--ink); font-size: 13px; color: var(--text-2); }
.row-notes li.is-off { border-color: rgba(255,138,61,.5); }
.row-notes li.is-off b { color: #FF8A3D; }
.row-notes li.is-ok b { color: var(--text); }
.row-fighter { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.row-fighter p { margin: 0; }
.row-fighter-name a { font: 700 16px var(--cond); text-transform: uppercase; color: var(--text); text-decoration: none; }
.row-fighter-note { display: flex; flex-direction: column; gap: 2px; }
.row-note-skill { font: 600 12px var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row-note-text { font-size: 13px; color: var(--text-2); }
.team-fx-row .drop-caret { align-self: center; flex: none; }
.team-fx-row[aria-expanded="true"] .drop-caret { transform: translateY(2px) rotate(-135deg); }
.team-fx-more { display: flex; flex-direction: column; gap: 6px; padding: 2px 10px 10px; }
.team-fx-desc { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); white-space: pre-line; }
.team-fx-by { display: flex; flex-direction: column; gap: 2px; }
.team-fx-who { margin: 0; font-size: 12px; color: var(--muted); }
.team-fx-who b { color: var(--text); font-weight: 600; }

/* a whole team panel as a drawer: the heading carries a summary while it's closed */
.panel-drawer-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.panel-drawer-btn h2, .panel-drawer-btn h3 { margin: 0; }
.panel-summary { margin-left: auto; min-width: 0; font-size: 14px; color: var(--muted); text-align: right; }
.panel-summary.is-warn { color: #FF8A3D; }
.panel-drawer-btn .drop-caret { flex: none; }
.panel-drawer-btn[aria-expanded="true"] .drop-caret { transform: translateY(2px) rotate(-135deg); }
.panel-drawer-body { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }

/* buff and debuff icons */
.fx-ico { width: 20px; height: 20px; flex: none; object-fit: contain; }
.fx-ico-inline { width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; }
.fx-icon .fx-ico { width: 26px; height: 26px; }
.fx-line .fx-ico { width: 16px; height: 16px; }
.chip .fx-ico, .info-fx .fx-ico { width: 18px; height: 18px; }
.is-both { --fx: #B79CFF; --fx-soft: rgba(183,156,255,.14); }

/* buffs & debuffs page */
.fx-kinds { padding-top: 16px; }
.fx-page { padding-bottom: 32px; }
.fx-kind { margin-bottom: 28px; }
.fx-kind > .h-sub { color: var(--fx); margin-bottom: 14px; }
.fxc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.fxc { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--fx); border-radius: 10px; min-width: 0; }
.fxc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fxc-ico { width: 48px; height: 48px; flex: none; object-fit: contain; border-radius: 8px; background: var(--fx-soft); padding: 4px; }
.fxc-none { display: inline-block; }
.fxc-title { min-width: 0; }
.fxc-title h3 { margin: 0; font: 700 19px/1.1 var(--cond); letter-spacing: .03em; text-transform: uppercase; overflow-wrap: anywhere; }
.fxc-kind { margin: 2px 0 0; font-size: 12px; color: var(--fx); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.fxc-facts { margin: 0; font-size: 13px; color: var(--muted); }
.fxc-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); white-space: pre-line; }
.fxc-used summary { cursor: pointer; font: 600 12px var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fxc-users { display: flex; flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; font-size: 13px; }
.fxc-users a:not(.btn) { color: var(--text); text-decoration: none; }
.fxc-users a:not(.btn):hover { text-decoration: underline; }
.fxc-users .btn { margin-top: 4px; }
.fxg-jump { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 16px; }
.fxg-jump .chip { height: 34px; padding: 0 12px; min-width: 34px; justify-content: center; }
.fxg-letter { margin-bottom: 20px; scroll-margin-top: 90px; }
.fxg-list { margin: 0; display: flex; flex-direction: column; }
.fxg-term { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.fxg-ico { width: 40px; height: 40px; grid-row: span 2; object-fit: contain; border-radius: 8px; background: var(--fx-soft); padding: 3px; }
.fxg-term dt { font: 700 17px var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.fxg-kind { margin-left: 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--fx); }
.fxg-term dd { margin: 2px 0 0; display: flex; flex-direction: column; gap: 2px; }
.fxg-term .fxc-facts { font-size: 12px; }
.team-fx-row .fx-ico { width: 18px; height: 18px; align-self: center; }

/* opening timeline */
.tl-track { position: relative; height: 186px; margin: 8px 6px 4px; }
.tl-line { position: absolute; left: 0; right: 0; top: 92px; height: 4px; border-radius: 2px; background: var(--line-2); }
.tl-mark { position: absolute; left: var(--x); width: 46px; margin-left: -23px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tl-mark.is-up { bottom: 100px; flex-direction: column; }
.tl-mark.is-down { top: 100px; flex-direction: column-reverse; padding-top: 14px; }
.tl-mark.is-up::after { content: ""; width: 1px; height: 10px; background: var(--line-2); }
.tl-mark.is-down::before { content: ""; position: absolute; top: 0; width: 1px; height: 10px; background: var(--line-2); }
.tl-art { position: relative; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--rc); background: var(--ink); }
.tl-art img, .tl-art .ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.tl-n { position: absolute; left: 0; top: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--text); color: var(--ink); font: 700 11px/18px var(--cond); text-align: center; }
.tl-n-row { position: static; }
.tl-dex { font: 700 14px var(--cond); letter-spacing: .04em; color: var(--text-2); }
.is-mod { color: #FF8A3D; }
.tl-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.tl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tl-n-row { flex: none; display: inline-block; }
.tl-who { flex: 1 1 160px; min-width: 0; }
.tl-nums { font-size: 15px; }
.tl-nums s { font-size: 12px; }
.tl-mods { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-mod { padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(255,138,61,.5); color: #FF8A3D; font-size: 12px; }
.tl-tie { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 12px; }
.tl-note { margin: 8px 0 0; }
.tl-chevs { position: absolute; left: 0; right: 0; top: 88px; height: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.tl-chevs i { width: 9px; height: 9px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); opacity: var(--o); }
.tl-chevs i:last-child { width: 12px; height: 12px; }
.tl-tie-note { margin: 0 0 4px; }
.tl-tie-note b { color: var(--text-2); font-weight: 600; }

/* keepsakes */
.ks-ico { display: block; object-fit: contain; flex: none; }
.ks-chip { width: 20px; height: 20px; }
.skill-head { position: relative; }
.skill-lvl { margin-left: auto; align-self: flex-start; white-space: nowrap; flex: none; padding: 2px 8px; border: 1px solid var(--kc, #8B8E9A); border-radius: 6px; color: var(--kc, #8B8E9A); font: 700 13px var(--cond); letter-spacing: .06em; }
.skill-dmg { margin: 0 0 6px; font-weight: 700; }
.star-row { display: flex; flex: 1; min-width: 0; gap: 0; flex-wrap: nowrap; }
.star-btn { flex: 1 1 0; min-width: 0; padding: 4px 0; border: 0; background: transparent; color: #9094A8; font-size: clamp(18px, 6vw, 26px); line-height: 1; cursor: pointer; transition: color .18s ease; }
.star-btn.is-on { color: #FFD21F; }
.star-btn.is-on.is-evo { color: #3BA7FF; }
/* picking: lit stars pop and dimmed ones dip, one after another (the delay is set per star); movement only, so nothing is repainted */
.star-btn.pop, .star-btn.off { transition-delay: var(--d, 0ms); animation-delay: var(--d, 0ms); animation-fill-mode: backwards; }
.star-btn.pop { animation: star-pop .42s cubic-bezier(.3, 1.4, .5, 1); }
.star-btn.off { animation: star-dip .22s ease; }
@keyframes star-pop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.45) rotate(-14deg); } 70% { transform: scale(.94) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes star-dip { 50% { transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .star-btn.pop, .star-btn.off { animation: none; transition-delay: 0ms; } }
.star-btn:hover { color: #FFE45C; }
.star-btn:nth-child(n+6):hover { color: #7CC4FF; }
.star-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.art-layout { display: block; width: 100%; max-width: 560px; height: auto; margin: 12px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.art-layout-box { margin: 8px 0 12px; }
.lay-pics { display: grid; gap: 24px; justify-items: start; }
.lay-fig { margin: 0; display: grid; gap: 6px; max-width: 100%; }
.lay-pic { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.building { margin: 8px auto 4px; }
.bld { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: center; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.bld:not(:has(.bld-pic)) { grid-template-columns: minmax(0, 1fr); }
.bld-pic { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; }
.bld-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.bld-icon { width: 40px; height: 40px; object-fit: contain; }
.bld-text p { margin: 0 0 12px; }
.bld-facts { display: grid; gap: 8px; margin: 0; }
.bld-facts dt { color: var(--muted); font-size: 13px; }
.bld-facts dd { display: flex; align-items: center; gap: 8px; margin: 0; }
.bld-cur { width: 24px; height: 24px; object-fit: contain; }
@media (max-width: 700px) { .bld { grid-template-columns: minmax(0, 1fr); } }
.vid-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.vid-share input[type=url] { width: 100%; }
.notes-block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.notes-block .band-head { margin-bottom: 14px; }
/* buffs and debuffs come first in the column: no rule above them, and one between them and the insights */
.notes-col > .notes-block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.notes-col > .notes-block + .band-head { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.notes-drawer > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; list-style: none; }
.notes-drawer > summary::-webkit-details-marker { display: none; }
.notes-drawer > summary .h-sub { margin: 0; }
.notes-drawer > summary .drop-caret { margin-left: auto; flex: none; }
.notes-drawer > summary .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-msg:empty { display: none; }
.notes-drawer[open] > summary .drop-caret { transform: translateY(2px) rotate(-135deg); }
.notes-drawer > summary:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 6px; }
.notes-drawer > .tiers { margin-top: 14px; }
.notes-side { display: grid; gap: 16px; align-content: start; }
.scores { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.sc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.sc-head .btn { margin-left: auto; }
.sc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sc-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; }
.sc-word { font-weight: 600; }
.rt { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2.5px solid var(--rk); border-radius: 10px; color: var(--rk); font: 400 24px/1 var(--display); }
.rt.sm { width: 32px; height: 32px; font-size: 17px; border-width: 2px; border-radius: 8px; }
.rt.none { border-style: dashed; border-color: var(--line-2); color: var(--muted); }
.sc-sub { margin: 16px 0 8px; color: var(--muted); font: 600 13px var(--cond); letter-spacing: .08em; text-transform: uppercase; }
.sc-prio, .sc-syn { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-syn { align-items: center; }
.sc-pc { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px; background: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; }
.sc-pn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.sc-track { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.sc-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sc-grp { margin-bottom: 8px; }
.sc-grp p { margin: 0 0 4px; }
.sc-mode { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; margin-bottom: 6px; background: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; }
.sc-sy { padding: 4px 12px; border-radius: 8px; background: rgba(61, 214, 140, .14); color: #3DD68C; }
.sc-syf { display: inline-flex; border-radius: 8px; }
.sc-syf:hover .sc-syf-face { border-color: var(--text); }
.sc-syf-face { width: 44px; height: 44px; flex: none; border-radius: 6px; border: 2px solid var(--rc); background: var(--panel); object-fit: cover; object-position: top; }
.sc-chip-face { width: 22px; height: 22px; flex: none; margin-right: 6px; border-radius: 4px; background: var(--panel-2); object-fit: cover; object-position: top; }
.sc-erow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.sc-el { flex: 1; min-width: 120px; }
.rk { display: inline-flex; gap: 4px; }
.rk button { width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--line-2); border-radius: 6px; background: transparent; color: var(--muted); font: 400 15px var(--display); cursor: pointer; }
.rk button[aria-pressed="true"] { border-color: var(--rk); color: var(--rk); background: var(--ink); }
.sc-chip { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 6px 0; padding: 2px 4px 2px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.sc-chip button { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.sc-chip button:disabled { opacity: .35; cursor: default; }
.sc-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.sc-add select, .sc-add input { flex: 1; min-width: 140px; }
.sc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
