/* style-prep.css — preparation phase UI (lacquer kit) */
#ui-prep {
  --u: 1;
  --slot: max(44px, calc(64px * var(--u)));
  --f16: max(16px, calc(21px * var(--u)));
  --f14: max(14px, calc(17px * var(--u)));
  --f12: max(12px, calc(14px * var(--u)));
  --chipH: max(36px, calc(42px * var(--u)));
  --btnH: max(44px, calc(52px * var(--u)));
  --panelW: min(42vw, calc(520px * var(--u)));
  --panelTop: max(64px, calc(72px * var(--u)));
  --pb: 22px;
  font-family: var(--font); font-weight: 900; color: var(--cream); text-shadow: var(--outline);
  display: none;
}
#ui-prep.compact { --pb: 14px; --panelTop: 58px; }
#ui-prep > * { position: absolute; box-sizing: border-box; }
#ui-prep *, #ui-prep *::before, #ui-prep *::after { box-sizing: border-box; }
#ui-prep img { pointer-events: none; }
.pp-soft { text-shadow: 0 1px 0 #2a0805, 0 0 3px #2a0805; font-weight: 700; }

/* lacquer plate with gold rim */
.pp-plate { background: linear-gradient(180deg, #a3281d 0%, #6a120c 55%, #4a0b08 100%); border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.6), inset 0 0 0 2px #2a0805, inset 0 3px 0 rgba(255,255,255,.22), inset 0 -6px 10px rgba(0,0,0,.28); }
.pp-plate::before { content: ""; position: absolute; inset: 3px; border-radius: 9px; background: var(--lq-grain); pointer-events: none; opacity: .8; }

@keyframes pp-glow { 0%,100% { box-shadow: 0 0 4px 1px rgba(255,220,120,.5), 0 4px 10px rgba(0,0,0,.6), inset 0 0 0 2px #2a0805; } 50% { box-shadow: 0 0 12px 4px rgba(255,220,120,.9), 0 4px 10px rgba(0,0,0,.6), inset 0 0 0 2px #2a0805; } }
@keyframes pp-boss { 0%,100% { box-shadow: 0 0 5px 1px rgba(255,60,40,.7); } 50% { box-shadow: 0 0 14px 5px rgba(255,80,50,1); } }
@keyframes pp-pulse { 0%,100% { filter: drop-shadow(0 0 4px rgba(255,200,90,.55)); } 50% { filter: drop-shadow(0 0 14px rgba(255,210,100,1)) brightness(1.1); } }
@keyframes pp-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pp-flip { 0% { transform: rotateY(90deg) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- tiles (hit boxes) */
.pp-tiles { inset: 0; pointer-events: none; }
.pp-tile { position: absolute; background: transparent; pointer-events: auto; border-radius: 10px; }
.pp-tile.focus { outline: 3px solid var(--gold-hi); outline-offset: -3px; }

/* ---------- HUD */
.pp-hud { left: 72px; top: 8px; display: flex; flex-direction: column; gap: 3px; pointer-events: none !important; }
.pp-hrow { display: flex; gap: 6px; }
.pp-chip { position: relative; height: var(--chipH); padding: 0 10px 0 calc(var(--chipH) * .8); margin-left: calc(var(--chipH) * .3); display: flex; align-items: center; gap: 6px; font-size: var(--f16); white-space: nowrap; }
.pp-chip > b, .pp-lcol { position: relative; z-index: 1; }
.pp-disc { position: absolute; left: calc(var(--chipH) * -.3); top: 50%; width: calc(var(--chipH) * .95); height: calc(var(--chipH) * .95); transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1b8, #d9a23a 45%, #7a4810); border: 2px solid #2a0805; box-shadow: 0 2px 4px rgba(0,0,0,.6), inset 0 0 0 2px #ffe7a3;
  display: flex; align-items: center; justify-content: center; z-index: 2; }
.pp-disc img { width: calc(var(--chipH) * .6); height: calc(var(--chipH) * .6); object-fit: contain; flex: none; }
.pp-heart { background: radial-gradient(circle at 35% 30%, #5a1410, #2a0805); }
.pp-heart svg { display: block; width: calc(var(--chipH) * .55); height: calc(var(--chipH) * .55); flex: none; }
.pp-hp b { color: #ffd9d0; }
.pp-wave.isboss { border-color: #ff7a5a; background: linear-gradient(180deg, #c4160e, #6a0a06); animation: pp-boss 1.2s infinite; }
.pp-wave { padding-left: 12px; margin-left: 0; }
.pp-boss { font-style: normal; background: linear-gradient(#ff5a3a, #b0100a); border: 1.5px solid var(--gold-hi); border-radius: 6px; padding: 0 6px; font-size: var(--f12); letter-spacing: 1px; position: relative; z-index: 1; }
.pp-coins b { color: var(--gold-hi); min-width: 1.5em; font-size: calc(var(--f16) * 1.1); }
.pp-lord { padding-right: 12px; }
.pp-lcol { display: flex; flex-direction: column; gap: 2px; justify-content: center; font-size: var(--f14); line-height: 1; }
.pp-lcol .pp-xp { height: 9px; padding: 2px; border-radius: 5px; width: 100%; min-width: 80px; }
.pp-lcol .pp-xp::before { inset: 2px; border-radius: 3px; }
.pp-lcol .pp-xp > i { border-radius: 3px; width: 0; }
.pp-lcol .pp-xp > i::after { display: none; }
.pp-deploy { padding-left: 12px; margin-left: 0; }
.pp-deploy.full b { color: #ff7a6a; }
/* phones held sideways: the chip row must end left of the pause button (top-right 64 px) */
@media (max-width: 900px) {
  .pp-hud { transform: scale(.88); transform-origin: 0 0; }
  .pp-hrow { gap: 3px; }
  .pp-lcol .pp-xp { min-width: 52px; }
}
.pp-next { font-size: var(--f12); max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }

/* ---------- bonds */
/* below the 主公 on the gatehouse terrace (screen left), above the bench, clear of the board's left edge */
.pp-bonds { left: 8px; top: 51%; display: flex; flex-direction: column; gap: 4px; width: max(132px, calc(150px * var(--u))); }
.pp-bchip { height: max(40px, calc(44px * var(--u))); padding: 0 6px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: var(--f12);
  opacity: .66; filter: saturate(.55); cursor: pointer; animation: pp-pop .2s ease-out backwards; transition: transform .12s; overflow: hidden; line-height: 1.05; }
.pp-bchip::before { inset: auto; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 0; background: var(--bc, var(--gold)); opacity: 1; }
.pp-bchip .bn { position: relative; z-index: 1; flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pp-bchip .br { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pp-bchip em { font-style: normal; font-size: var(--f12); color: var(--gold-hi); background: #2a0805; border-radius: 8px; padding: 0 6px; }
.pp-bchip.on { opacity: 1; filter: none; border-color: var(--gold-hi); animation: pp-glow 2.2s infinite; background: linear-gradient(180deg, #c03020, #75140d); }
.pp-bchip:active { transform: scale(.94); }
.pp-bchip.focus { outline: 3px solid var(--gold-hi); }
.pp-pips { display: inline-flex; gap: 3px; align-items: center; }
.pp-pips u { width: 7px; height: 7px; border-radius: 50%; background: #2a0805; border: 1px solid rgba(255,230,160,.4); display: block; }
.pp-pips u.lit { background: radial-gradient(circle at 35% 30%, #fff6c8, #f4c55a 60%, #b8780e); border-color: #2a0805; box-shadow: 0 0 5px rgba(255,214,110,.9); }
.pp-pips.big u { width: 10px; height: 10px; }
.pp-tip { z-index: 30; width: max(220px, calc(290px * var(--u))); padding: 0; font-size: var(--f12); display: none; pointer-events: auto; }
.pp-tip > * { margin-left: 2px; margin-right: 2px; }
.pp-tip.on { display: block; animation: pp-pop .18s ease-out backwards; }
.pp-tip h4 { margin: 0 0 4px; font-size: var(--f14); color: var(--gold-hi); }
.pp-tip p { margin: 0 0 6px; }
.pp-tip .tr { padding: 2px 6px; border-radius: 6px; opacity: .6; }
.pp-tip .tr.cur { opacity: 1; background: rgba(244,197,90,.28); box-shadow: inset 0 0 0 1px var(--gold); }

/* ---------- right button row */
.pp-right { right: 12px; bottom: 10px; width: var(--panelW); display: flex; flex-direction: row; align-items: flex-end; gap: 8px; }
.pp-right .lq-btn { position: relative; flex: 1 1 0; min-width: 0; font-size: var(--f14); min-height: var(--btnH); white-space: nowrap; }
.pp-bi { display: inline-flex; flex: none; }
.pp-right .pp-fight { flex: 1.5 1 0; min-height: calc(var(--btnH) + 14px); font-size: calc(var(--f16) * 1.15); flex-direction: column; gap: 0; line-height: 1.1; letter-spacing: 2px; }
.pp-right .pp-fight.ready { animation: pp-pulse 1.5s ease-in-out infinite; }
.pp-hk { font-size: var(--f12); color: var(--gold-hi); font-weight: 700; letter-spacing: 0; }
.pp-badge { position: absolute; right: -6px; top: -10px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: radial-gradient(circle at 35% 30%, #fff1b8, #f4c55a 60%, #b8780e); color: #3a0b08; text-shadow: none;
  font-size: var(--f12); display: flex; align-items: center; justify-content: center; border: 2px solid #2a0805; pointer-events: none; }
.pp-sell { right: 12px; bottom: 10px; width: var(--panelW); height: calc(var(--btnH) + 14px); display: none; align-items: center; justify-content: center; flex-direction: column;
  font-size: var(--f16); background: radial-gradient(ellipse at 50% 120%, rgba(255,120,80,.6), transparent 70%), linear-gradient(180deg, #d0281c, #7a0f0a); border: 3px dashed var(--gold-hi); border-radius: 14px; z-index: 40;
  box-shadow: 0 0 16px 3px rgba(255,70,40,.7), inset 0 0 18px rgba(0,0,0,.4); }
.dragging .pp-sell { display: flex; animation: pp-pop .2s ease-out backwards; }
.pp-sell.hot { background: radial-gradient(ellipse at 50% 120%, rgba(255,200,120,.8), transparent 70%), linear-gradient(180deg, #ff4a38, #b01510); transform: scale(1.05); box-shadow: 0 0 26px 8px rgba(255,200,90,.9); }
.pp-sell .pp-sp { display: flex; align-items: center; gap: 4px; color: var(--gold-hi); font-size: calc(var(--f16) * 1.1); }
.pp-sell img, .pp-sv img { width: 1.15em; height: 1.15em; object-fit: contain; }
.dragging .pp-right { visibility: hidden; }

/* ---------- bench: carved sockets */
.pp-bench { left: 10px; bottom: 8px; display: flex; gap: max(6px, calc(10px * var(--u))); padding: 6px 8px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(110,46,40,.88), rgba(70,30,26,.92)); border: 1.5px solid rgba(230,194,126,.8); border-radius: 16px; box-shadow: 0 6px 14px rgba(20,6,4,.35), inset 0 2px 0 rgba(255,236,200,.15); }
.pp-slot { position: relative; width: var(--slot); height: var(--slot); border-radius: 12px; border: 2px solid #4a241d; cursor: pointer; transition: transform .12s;
  background: radial-gradient(circle at 50% 40%, #5a2a24, #3a1b17); box-shadow: inset 0 4px 8px rgba(0,0,0,.85), inset 0 -1px 0 rgba(255,220,150,.25), 0 1px 0 rgba(255,220,150,.18); }
.pp-slot.full { box-shadow: 0 3px 6px rgba(0,0,0,.5); }
.pp-por { position: absolute; inset: 0; border-radius: 7px; background-size: 170%; background-position: center 18%; background-repeat: no-repeat; pointer-events: none; }
.pp-stars { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: var(--f12); color: var(--gold); line-height: 1; padding-bottom: 1px; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.6)); border-radius: 0 0 7px 7px; }
.pp-ibadge { position: absolute; right: -5px; top: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: #2c7be0; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 1.5px solid #2a0805; pointer-events: none; z-index: 4; }
.pp-slot.sel { transform: translateY(-4px) scale(1.08); border-color: var(--gold-hi); box-shadow: 0 0 12px 4px rgba(255,220,120,.9); }
.pp-tile.sel { transform: none; }
.pp-slot.focus { outline: 3px solid var(--gold-hi); }
.pp-slot.flash { animation: pp-glow .3s 3; }
.pp-slot.dim .pp-por { opacity: .35; }

/* ---------- right panels (tavern / equipment / hero) */
.pp-bottom, .pp-hero { right: 12px; top: var(--panelTop); width: var(--panelW); border-width: var(--pb); border-image-width: var(--pb); padding: 0; display: none; flex-direction: column; gap: 6px; z-index: 5; }
.pp-bottom { bottom: calc(var(--btnH) + 26px); }
.pp-bottom.on { display: flex; }
.has-hero .pp-bottom { display: none; }
.dragging .pp-bottom, .dragging .pp-hero { opacity: 0; pointer-events: none; }
.pp-top { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: var(--f14); margin-top: -4px; padding-right: 34px; }
.pp-top .grow { flex: 1; display: flex; align-items: center; justify-content: flex-end; font-size: var(--f12); min-width: 0; }
.pp-top .lq-ribbon { margin: 0 14px 0 0; padding: 5px 26px 8px; font-size: var(--f16); flex: none; }
.compact .pp-top .lq-ribbon { padding: 3px 22px 6px; font-size: var(--f14); }
.compact .pp-top { min-height: 30px; }
.pp-odds { gap: 8px; flex-wrap: wrap; }
.pp-oddrow { display: grid; grid-template-columns: auto auto; gap: 0 8px; justify-content: end; line-height: 1.2; }
.pp-oddrow .od { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.pp-oddrow .od i { width: 9px; height: 9px; transform: rotate(45deg); background: var(--oc); border: 1.5px solid #2a0805; display: block; }
.compact .pp-pips.big { display: none; }
.pp-pick { text-align: right; line-height: 1.1; }
.pp-x { margin-top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #2a0805; background: radial-gradient(circle at 35% 30%, #d03a2a, #6a120c 70%); color: var(--cream); font-size: 24px; font-weight: 900; font-family: var(--font); text-shadow: var(--outline);
  box-shadow: 0 0 0 2px var(--gold), 0 3px 6px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: transform .12s, filter .12s; position: absolute; right: -10px; top: -14px; z-index: 3; }
.pp-x:hover { filter: brightness(1.2); } .pp-x:active { transform: scale(.9); } .pp-x.focus { outline: 3px solid var(--gold-hi); outline-offset: 2px; }

.pp-cards { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.pp-card { position: relative; min-width: 0; min-height: 0; padding: 4px 6px 4px 4px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, rgba(122,52,44,.95), rgba(70,30,26,.95)); display: grid; grid-template-columns: 50% 1fr; grid-template-rows: 1fr auto auto auto auto 1fr; align-content: stretch; align-items: center; column-gap: 6px; row-gap: 3px; text-align: left;
  font-size: var(--f12); transition: transform .14s cubic-bezier(.3,1.6,.5,1), filter .12s; overflow: hidden; }
.pp-card > .nm, .pp-card > .pp-tags, .pp-card > .pp-price, .pp-card > .pp-own { grid-column: 2; }
.pp-card > .nm { grid-row: 2; }
.pp-card > .pp-tags { grid-row: 3; flex-wrap: wrap; row-gap: 2px; }
.pp-card > .pp-price { grid-row: 4; }
.pp-card > .pp-own { grid-row: 5; }
.pp-card .pp-por { position: relative; inset: auto; grid-row: 1 / -1; grid-column: 1; width: 100%; height: 100%; min-height: 40px; align-self: stretch; background-size: 150%; border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), inset 0 -12px 14px -8px rgba(0,0,0,.6);
  background-color: color-mix(in srgb, var(--fc, #888) 45%, #1a0503); }
.pp-card .nm { font-size: var(--f14); line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff6dc; }
.pp-card .pp-tags { justify-content: flex-start; overflow: hidden; }
.compact .pp-card .pp-tags span + span { display: none; }
.compact .pp-card > .pp-tags { flex-wrap: nowrap; }
.compact .pp-card { row-gap: 1px; }
.compact .pp-card:not(.merge) .pp-own { display: none; }
.pp-tags { display: flex; gap: 3px; justify-content: center; align-items: center; flex-wrap: nowrap; font-size: var(--f12); line-height: 1.2; }
.pp-tags span { padding: 0 6px; border-radius: 999px; background: rgba(58,24,20,.85); white-space: nowrap; }
.pp-tags .gem { color: #1a0605; text-shadow: none; border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 1px rgba(58,24,20,.9); }
.pp-price { display: flex; align-items: center; gap: 3px; font-size: var(--f14); color: var(--gold-hi); width: fit-content; padding: 0 8px 0 4px; border-radius: 9px; background: rgba(48,20,16,.6); box-shadow: inset 0 0 0 1px rgba(230,194,126,.5); }
.pp-price img { width: 1.15em; height: 1.15em; object-fit: contain; }
.pp-price.poor { color: #ff7a6a; }
.pp-own { font-size: var(--f12); color: #bfe9ff; min-height: 1.2em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-card.merge { animation: pp-glow 1.2s infinite; }
.pp-card.merge .pp-own { color: var(--gold-hi); }
/* request 33: star colours — 1★ silver, 2★ gold, 3★ glowing red-gold (bench sockets, detail panel, tavern tag) */
.pp-stars[data-s="1"], .pp-hh .stars[data-s="1"] { color: #e6edf5; text-shadow: 0 0 2px #2e3846, 0 1px 0 #2e3846; }
.pp-stars[data-s="2"], .pp-hh .stars[data-s="2"] { color: #ffc41f; font-size: calc(var(--f12) * 1.25); text-shadow: 0 0 3px #5a2c02, 0 0 6px rgba(255,200,60,.8); }
.pp-stars[data-s="3"], .pp-hh .stars[data-s="3"] { color: #ff7a2a; font-size: calc(var(--f12) * 1.35); text-shadow: 0 0 2px #4a0804, 0 0 6px #ff5a1a, 0 0 10px #ffcf5a; animation: pp-star3 1.4s ease-in-out infinite; }
.pp-hh .stars[data-s="2"], .pp-hh .stars[data-s="3"] { font-size: calc(var(--f14) * 1.2); }
@keyframes pp-star3 { 50% { filter: brightness(1.35); } }
.pp-slot.star2 { border-color: #ffc41f; box-shadow: 0 0 8px 2px rgba(255,196,31,.65), 0 3px 6px rgba(0,0,0,.5); }
.pp-slot.star3 { border-color: #ff6a2a; box-shadow: 0 0 12px 4px rgba(255,90,30,.75), 0 0 4px 1px #ffd76a inset, 0 3px 6px rgba(0,0,0,.5); }
/* request 41: ::before, not ::after (SSR/UR cards use ::after for their full-card shine, inset: 0, which turned this tag into a dark box over the card),
   and a grid item of the text column just above the name, so it never covers the portrait, name or price */
.pp-card.own2::before { content: "★★"; position: static; grid-column: 2; grid-row: 1; align-self: end; justify-self: start; pointer-events: none; color: #ffc41f; font-size: var(--f12); line-height: 1;
  padding: 1px 6px; border-radius: 8px; background: rgba(76,32,28,.88); border: 1.5px solid #ffc41f; text-shadow: 0 0 4px rgba(255,200,60,.9); }
/* phones: the text column has no spare row, so the tag sits in the portrait's free bottom-right corner (the lock is bottom-left) */
.compact .pp-card.own2::before { grid-column: 1; grid-row: 1 / -1; align-self: end; justify-self: end; margin: 0 2px 2px 0; position: relative; z-index: 4; padding: 1px 4px; }
.pp-card.poor { filter: grayscale(.6) brightness(.78); }
.pp-card.empty { visibility: hidden; }
.pp-card.flip { animation: pp-flip .3s ease-out backwards; }
.pp-card:hover, .pp-card.focus { transform: translateY(-3px) scale(1.02); filter: brightness(1.15); z-index: 2; }
.pp-card.focus { outline: 3px solid var(--gold-hi); }
.pp-card:active { transform: scale(.95); }
.pp-card.poor:hover { filter: grayscale(.6) brightness(.88); }
.pp-btns { display: flex; gap: 6px; }
.pp-btns .lq-btn { flex: 1 1 0; min-width: 0; font-size: var(--f14); white-space: nowrap; }
.pp-btns .lq-btn .gl { font-size: 1.3em; color: var(--gold-hi); line-height: 1; }
.compact .pp-btns .lq-btn { border-width: 8px 10px; border-image-width: 8px 10px; padding: 0 1px; min-height: 44px; }
.compact .pp-btns .gl { display: none; }
.compact .pp-btns .bt > span { font-size: var(--f12); letter-spacing: -0.02em; }
.compact .pp-card .nm { font-size: var(--f12); letter-spacing: -0.02em; }
.compact .pp-btns .bt { align-items: center; }
.pp-btns .bt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.pp-btns .bt > span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pp-btns small { font-size: var(--f12); color: var(--gold-hi); display: inline-flex; align-items: center; gap: 2px; }
.pp-btns small img { width: 1.1em; height: 1.1em; object-fit: contain; }
.pp-btns .lq-btn.disabled small { color: #ff9a8a; }

/* equipment */
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(130px, calc(160px * var(--u))), 1fr)); align-content: start; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; touch-action: pan-y; }
.pp-grid::-webkit-scrollbar { display: none; }
.pp-item { display: flex; gap: 6px; align-items: center; padding: 4px; min-height: 52px; border-radius: 10px; background: linear-gradient(180deg, rgba(122,52,44,.9), rgba(70,30,26,.95)); border: 2px solid rgba(244,197,90,.55); cursor: pointer; font-size: var(--f12); transition: transform .12s; }
.pp-item .sock, .pp-eq { border-radius: 8px; background: radial-gradient(circle at 50% 40%, #5a2a24, #3a1b17); box-shadow: inset 0 3px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,220,150,.25); border: 2px solid #2a0805; }
.pp-item .sock { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.pp-item img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.pp-item .it { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; gap: 1px; }
.pp-item .it b { font-size: var(--f12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-item .it .pp-soft { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pp-item.pend { border-color: var(--gold-hi); animation: pp-glow 1s infinite; }
.pp-item:hover { transform: translateY(-2px); }
.pp-item:active { transform: scale(.95); } .pp-item.focus { outline: 3px solid var(--gold-hi); }
.pp-empty { padding: 14px; text-align: center; font-size: var(--f14); opacity: .85; }

/* ---------- hero panel */
.pp-hero { max-height: calc(100% - var(--panelTop) - var(--btnH) - 22px); overflow-y: auto; scrollbar-width: none; }
.pp-hero.on { display: flex; }
.pp-hh { display: flex; gap: 8px; align-items: center; padding-right: 34px; }
.pp-hh .pp-por { position: relative; inset: auto; flex: none; width: max(56px, calc(76px * var(--u))); height: max(56px, calc(76px * var(--u))); border-radius: 10px;
  background-color: color-mix(in srgb, var(--fc, #888) 45%, #1a0503); }
.pp-hh .inf { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pp-hh .nm { font-size: var(--f16); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-hh .tt { font-size: var(--f12); color: var(--gold-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-hh .pp-tags { justify-content: flex-start; }
.pp-hh .stars { color: var(--gold); font-size: var(--f14); line-height: 1; letter-spacing: 1px; }
.pp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 8px; font-size: var(--f12); }
.pp-stats div { display: flex; justify-content: space-between; gap: 4px; white-space: nowrap; padding: 2px 0; border-bottom: 1px solid rgba(244,197,90,.4); }
.pp-stats i { font-style: normal; color: var(--gold); }
.pp-stats div { padding: 1px 0; }
.pp-stats .hi b { color: #ffe08a; }
.pp-stats .hi i { color: #ffb36a; }
.pp-skill { font-size: var(--f12); line-height: 1.2; padding: 5px 8px 6px; border-radius: 8px; color: #3a1608; text-shadow: none;
  background: linear-gradient(180deg, #fff4d8, #ecd29a); box-shadow: inset 0 0 0 2px #b98a3a, inset 0 0 12px rgba(120,70,10,.35), 0 2px 4px rgba(0,0,0,.5); }
.pp-skill b { color: #8a1410; font-size: var(--f14); display: block; }
.pp-skill .pp-soft { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-shadow: none; font-weight: 700; color: #3a1608; }
.compact .pp-skill .pp-soft { -webkit-line-clamp: 3; }
.pp-eqrow { display: flex; gap: 5px; align-items: center; }
.pp-eq { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: transform .12s; }
.pp-eq.f { border-color: var(--gold); } .pp-eq img { width: 34px; height: 34px; object-fit: contain; } .pp-eq:active { transform: scale(.9); } .pp-eq.focus { outline: 3px solid var(--gold-hi); }
.pp-eqrow .lq-btn { flex: 1; min-width: 0; font-size: var(--f12); white-space: nowrap; }
.pp-bag { display: flex; gap: 4px; flex-wrap: wrap; max-height: 48px; overflow-y: auto; scrollbar-width: none; touch-action: pan-y; }
.pp-bag::-webkit-scrollbar { display: none; }
.pp-bag .pp-eq { border-color: rgba(244,197,90,.55); }

/* ---------- request 26: rarity badges, locks, 上一波戰績, scrolling bonds, readability */
.pp-rbadge { position: absolute; z-index: 4; pointer-events: none; display: flex; align-items: center; justify-content: center; font-weight: 900; font-style: normal; letter-spacing: -0.02em;
  border: 2px solid #1a0503; border-radius: 4px 9px 4px 9px; box-shadow: 0 2px 3px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.55); line-height: 1; text-shadow: none; }
.pp-rbadge[data-r="R"] { background: linear-gradient(180deg, #e2e8ee, #8e9aa6); color: #1d242b; }
.pp-rbadge[data-r="SR"] { background: linear-gradient(180deg, #8cc4ff, #2f74d8); color: #fff; text-shadow: 0 0 2px #0a2350, 0 1px 0 #0a2350; }
.pp-rbadge[data-r="SSR"] { background: linear-gradient(180deg, #e7a8ff, #9a3cd0); color: #fff; text-shadow: 0 0 2px #3a0a55, 0 1px 0 #3a0a55; }
.pp-rbadge[data-r="UR"] { background: linear-gradient(180deg, #fff1a8, #ffb52e 55%, #d9560e); color: #3a1200; box-shadow: 0 0 8px rgba(255,190,60,.9), inset 0 1px 0 rgba(255,255,255,.7); }
.pp-card .pp-rbadge { left: 2px; top: 2px; min-width: 2.2em; height: 1.45em; padding: 0 4px; font-size: calc(var(--f14) * 1.08); }
.pp-slot .pp-rbadge { left: -5px; top: -6px; min-width: 1.9em; height: 1.35em; padding: 0 3px; font-size: 11px; }
.pp-card[class*="rar-"] { border: 3px solid var(--rc); }
body.tut-on .pp-drops { visibility: hidden; }
.pp-lock { position: absolute; left: 2px; bottom: 2px; z-index: 4; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(20,4,2,.78); border: 1.5px solid rgba(244,197,90,.45); transition: transform .12s, filter .12s; }
.pp-lock svg { width: 22px; height: 22px; }
.pp-lock:hover, .pp-lock.focus { filter: brightness(1.25); outline: 2px solid var(--gold-hi); }
.pp-lock:active { transform: scale(.88); }
.pp-card.empty .pp-lock { display: none; }
.pp-card.locked { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 14px 4px rgba(255,214,110,.85); }
.pp-card.locked .pp-lock { background: linear-gradient(180deg, #7a1a10, #3a0805); border-color: var(--gold-hi); box-shadow: 0 0 8px rgba(255,214,110,.9); }
.pp-lastbtn { position: absolute; z-index: 6; min-height: 44px; min-width: 44px; padding: 0 10px; display: flex; align-items: center; gap: 5px; font-size: var(--f12); white-space: nowrap; }
.pp-lastbtn svg { width: 22px; height: 18px; flex: none; }
.pp-lastbtn.disabled { filter: grayscale(1) brightness(.7); }
.compact .pp-lastbtn span { display: none; }
.pp-bonds { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; touch-action: pan-y; overscroll-behavior: contain; padding-right: 2px; }
.pp-bonds::-webkit-scrollbar { display: none; }
.pp-bonds .pp-bchip { flex: none; }
.pp-bhint { position: absolute; z-index: 6; display: none; text-align: center; font-size: 12px; font-weight: 800; color: var(--gold-hi); pointer-events: none;
  background: linear-gradient(180deg, rgba(60,26,22,.9), rgba(60,26,22,.6)); border-radius: 0 0 8px 8px; padding: 1px 0 2px; -webkit-text-stroke: 2px #1a0503; paint-order: stroke fill; animation: pp-pulse 1.4s ease-in-out infinite; }
.pp-bhint.on { display: block; }
.pp-bench.two { flex-wrap: wrap; }
/* readability: every small text sits on a dark plate with an outline */
.pp-next { background: rgba(60,26,22,.82); border-radius: 8px; padding: 2px 8px; box-shadow: inset 0 0 0 1px rgba(244,197,90,.45); color: #fff3d6; -webkit-text-stroke: 3px #1a0503; paint-order: stroke fill; }
.pp-bchip { opacity: .9; filter: saturate(.75) brightness(.9); background: linear-gradient(180deg, #4a1a12, #24070400); background-color: #2a0b06; color: #f3e6cc; -webkit-text-stroke: 3px #1a0503; paint-order: stroke fill; }
.pp-bchip.on { -webkit-text-stroke: 3px #2a0805; }
.pp-odds, .pp-oddrow .od { color: #fff3d6; -webkit-text-stroke: 3px #1a0503; paint-order: stroke fill; }
.pp-oddrow { background: rgba(60,26,22,.7); border-radius: 6px; padding: 1px 6px; }
.pp-tags span { color: #fff3d6; -webkit-text-stroke: 2.5px #1a0503; paint-order: stroke fill; }
.pp-own { -webkit-text-stroke: 2.5px #1a0503; paint-order: stroke fill; }
.pp-lastmodal .pp-lastbody { max-height: min(62vh, 440px); overflow-y: auto; scrollbar-width: none; touch-action: pan-y; min-width: min(560px, 86vw); }
.pp-lastmodal .pp-lastbody::-webkit-scrollbar { display: none; }

/* ghost + pop */
.pp-ghost { z-index: 60; width: max(56px, calc(72px * var(--u))); height: max(56px, calc(72px * var(--u))); margin: -28px 0 0 -28px; border-radius: 10px; border: 3px solid var(--gold-hi); background-color: rgba(40,8,5,.8);
  background-size: 170%; background-position: center 18%; background-repeat: no-repeat; pointer-events: none !important; display: none; left: 0; top: 0; opacity: .94; box-shadow: 0 12px 18px rgba(0,0,0,.6), 0 0 12px rgba(255,220,120,.6); }
.pp-ghost.on { display: block; }
.pp-mpop { z-index: 50; transform: translate(-50%, -50%); font-size: calc(var(--f16) * 1.3); color: var(--gold-hi); pointer-events: none !important; white-space: nowrap; }
