/* Player-to-player economy: Black Market player tabs, Gear Exchange (swap board, offers, gifts), profiles.
   Uses the theme tokens (--cyan, --mag, --line, ...) only, so it follows whatever theme.css sets. */

.p2p-tabs .dist-tab { display: inline-flex; align-items: center; gap: 6px; }
.p2p-count { display: inline-block; min-width: 18px; padding: 1px 5px; font: 700 10px/1.4 var(--font-d); text-align: center;
  background: var(--mag); color: #1a0d00; border-radius: 2px; letter-spacing: 0; }

.p2p-who { color: var(--cyan); text-decoration: none; font-weight: 600; border-bottom: 1px dotted var(--line2); overflow-wrap: anywhere; }
.p2p-who:hover { color: #fff; border-bottom-color: var(--cyan); }

.p2p-bar { margin-bottom: 12px; }
.p2p-sel { max-width: 100%; }
.p2p-h { margin: 18px 0 10px; }

/* item cards */
.p2p-card { align-items: start; min-width: 0; }
.p2p-card.mine { border-color: var(--line2); }
.p2p-cbody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.p2p-cbody .nm { overflow-wrap: anywhere; }
.p2p-by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.p2p-price { margin-top: 6px; gap: 8px; }
.p2p-note { color: var(--text); background: rgba(255, 255, 255, 0.03); border-left: 2px solid var(--line2); padding: 4px 8px;
  overflow-wrap: anywhere; white-space: pre-wrap; }
.p2p-wants { margin-top: 2px; }
.p2p-post.open { grid-template-columns: 64px minmax(0, 1fr); }
.p2p-formwrap { grid-column: 1 / -1; min-width: 0; }

/* selectable bag tiles */
.p2p-picks { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin: 6px 0 4px; }
.p2p-pick { position: relative; cursor: pointer; min-width: 0; }
.p2p-pick .item { width: 100%; }
.p2p-pick.on .item { outline: 2px solid var(--cyan); outline-offset: 1px; }
.p2p-pick.on::after { content: '✓'; position: absolute; top: 2px; left: 4px; z-index: 3; font: 700 12px var(--font-d); color: #032024;
  background: var(--cyan); padding: 0 4px; pointer-events: none; }

/* forms */
.p2p-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line2); min-width: 0; }
.p2p-step { font-size: 13px; margin-top: 4px; }
.p2p-crrow { gap: 8px; margin: 4px 0; }
.p2p-num { width: 120px; min-width: 0; }
.p2p-wide { width: 100%; min-width: 0; box-sizing: border-box; }
.p2p-grow { flex: 1 1 160px; min-width: 0; }
.p2p-seg { display: inline-flex; border: 1px solid var(--line2); }
.p2p-seg button { background: transparent; border: 0; color: var(--mute); padding: 7px 12px; font: 700 12px var(--font-d); letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; }
.p2p-seg button.on { background: var(--cyan); color: #032024; }
.p2p-seg button:not(.on):hover { color: var(--cyan); }
.p2p-fee { margin-top: 8px; max-width: 320px; }
.p2p-hint .row > span:first-child { color: var(--mute); }

/* compact list rows (my listings, my posts, gifts) */
.p2p-rows { display: flex; flex-direction: column; margin-top: 10px; }
.p2p-line { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.p2p-line .item { width: 52px; }
.p2p-lbtns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* offers */
.p2p-offer { margin-bottom: 12px; }
.p2p-ohead { gap: 8px; margin-bottom: 10px; }
.p2p-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.p2p-side { border: 1px solid var(--line); padding: 10px; background: rgba(0, 0, 0, 0.18); min-width: 0; }
.p2p-side.give { border-left: 2px solid var(--mag); }
.p2p-side.get { border-left: 2px solid var(--green); }
.p2p-lbl { font: 700 11px var(--font-d); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.p2p-sitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.p2p-sit { min-width: 0; }
.p2p-sit .item { width: 64px; }
.p2p-sit .small { margin-top: 3px; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.p2p-cr { margin-top: 8px; color: var(--yel); font-size: 16px; }
.p2p-arrow { align-self: center; font-size: 22px; color: var(--cyan); }
.p2p-terms { margin: 8px 0 4px; }
.p2p-oact { margin-top: 10px; gap: 8px; }

/* profile */
.p2p-who-card { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; align-items: start; }
.p2p-portrait { width: 100%; aspect-ratio: 3 / 4; border: 1px solid var(--line2); }
.p2p-pinfo h2 { font-size: 24px; margin: 2px 0 10px; overflow-wrap: anywhere; }
.p2p-eqgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 96px)); gap: 10px; justify-content: start; }
.p2p-eq { min-width: 0; text-align: center; }
.p2p-eq .item { width: 100%; }
.p2p-eq .small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2p-deal { margin-top: 16px; }

/* operative action row */
.p2p-opbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.p2p-opbtns .btn.on { background: var(--cyan); color: #032024; }

@media (max-width: 760px) {
  .p2p-sides { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .p2p-arrow { justify-self: center; transform: rotate(90deg); }
  .p2p-who-card { grid-template-columns: minmax(0, 1fr); }
  .p2p-portrait { max-width: 260px; margin: 0 auto; }
  .p2p-line { grid-template-columns: 44px minmax(0, 1fr); }
  .p2p-line .item { width: 44px; }
  .p2p-lbtns { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .p2p-num { width: 100px; }
  .p2p-tabs .dist-tab { padding: 7px 10px; }
  /* Pit / Rankings tables: let them scroll inside the panel rather than the page */
  #main .panel:has(> table.t) { overflow-x: auto; }
}
/* Friends */
.fr-card { display: flex; gap: 14px; align-items: flex-start; }
.fr-card .fr-pic { width: 72px; flex: none; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; }
.fr-info { min-width: 0; flex: 1; display: grid; gap: 3px; }
.fr-info .p2p-who { font-weight: 700; font-size: 17px; }
.fr-st { color: var(--mute, #7b979c); display: flex; align-items: center; gap: 6px; }
.fr-dot { width: 8px; height: 8px; border-radius: 50%; background: #4b5a5e; display: inline-block; }
.fr-dot.on { background: var(--green, #3ddc84); box-shadow: 0 0 6px var(--green, #3ddc84); }
.fr-btns { margin-top: 6px; gap: 6px; }
/* Syndicates */
.syn-list { display: grid; gap: 2px; }
.syn-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.syn-rk { font-size: 20px; color: var(--cyan); }
.syn-nm b { font-size: 16px; }
.syn-cs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.syn-c { font-size: 11px; }
.syn-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; max-width: 260px; text-align: right; }
.syn-req { padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); gap: 8px; }
.syn-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.syn-f { display: grid; gap: 4px; }
.syn-f input[type=number] { width: 100%; }
.syn-chk { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.syn-wide { grid-column: 1 / -1; }
.syn-ra { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 640px) {
  .syn-row { grid-template-columns: 36px minmax(0, 1fr); }
  .syn-act { grid-column: 2; justify-content: flex-start; text-align: left; max-width: none; }
  .syn-t th:nth-child(4), .syn-t td:nth-child(4) { display: none; }
}
/* Raids */
.raid-top { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: start; }
.raid-pic { border-radius: 6px; overflow: hidden; }
.raid-info h3 { margin: 2px 0 4px; }
.raid-hp { position: relative; height: 22px; margin-top: 10px; background: rgba(255, 60, 60, .12); border: 1px solid rgba(255, 90, 90, .35); overflow: hidden; }
.raid-hpbar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b3202b, #ff4d4d); transition: width .6s ease; }
.raid-hp span { position: relative; display: block; text-align: center; font: 600 12px/22px var(--font-d, sans-serif); color: #fff; letter-spacing: .06em; }
.raid-t { margin-top: 12px; }
.raid-btns { margin-top: 12px; gap: 10px; align-items: center; }
.raid-card.won .raid-hpbar { width: 0 !important; }
.raid-card.expired { opacity: .7; }
@media (max-width: 520px) { .raid-top { grid-template-columns: 96px minmax(0, 1fr); } }
.raid-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.raid-opt { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid rgba(70, 200, 210, .14); }
.raid-opt-pic { width: 64px; aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.raid-opt.lock { opacity: .5; }
/* Fight images on the combat report */
.fx-art { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.fx-art:empty { display: none; }
.fx-fr { margin: 0; overflow: hidden; border: 1px solid rgba(70, 200, 210, .2); aspect-ratio: 16 / 9; background: #050c10; animation: fxIn .6s ease both; }
.fx-fr:nth-child(2) { animation-delay: .25s; }
.fx-fr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-art:has(.fx-fr:only-child) { grid-template-columns: 1fr; max-width: 640px; }
@keyframes fxIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .fx-art { grid-template-columns: 1fr; } }
