/* ============================================================
   Auction Panel — v8 (PREMIUM: matches the auction-details design
   language). Glassmorphic cards, #0088ea accent, Poppins display,
   left accent bars, soft-blue icon tiles, glowing shadows, entrance
   animations, full light/dark parity. Layout mechanics unchanged:
   three equal-height columns that fill the viewport (no scroll),
   the team table IS the bid control. R1–R9.
   ============================================================ */

:root {
  --ap-blue: #0088ea;
  --ap-blue-d: #0067c7;
  --ap-blue-soft: rgba(0, 136, 234, .09);
  --ap-blue-tile: #eef7ff;
  --ap-green: #10b981;
  --ap-red: #ef4444;
  --ap-amber: #f59e0b;
  --ap-radius: 22px;
  --ap-radius-sm: 14px;
  --ap-font: 'Poppins', 'Manrope', sans-serif;
  --ap-ease: cubic-bezier(.16, 1, .3, 1);
  /* smooth solid-card recipe (same language as create-match / create-tournament) */
  --ap-glass: var(--color-surface);
  --ap-glass-brd: var(--color-border);
  --ap-glass-sh: 0 4px 24px rgba(15, 23, 42, .05);
  --ap-inset: var(--color-surface);   /* inner fields = plain white (border separates) */
}
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --ap-blue-soft: rgba(0, 136, 234, .16);
    --ap-blue-tile: rgba(0, 136, 234, .14);
    --ap-glass-sh: 0 10px 34px rgba(0, 0, 0, .42);
    --ap-inset: var(--color-surface-2);
  }
}
[data-theme="dark"] {
  --ap-blue-soft: rgba(0, 136, 234, .16);
  --ap-blue-tile: rgba(0, 136, 234, .14);
  --ap-glass-sh: 0 10px 34px rgba(0, 0, 0, .42);
  --ap-inset: var(--color-surface-2);
}

html { scrollbar-gutter: stable; }                  /* R3 */
body { overflow-x: clip; }                           /* R1 */
body.ap-modal-open { overflow: hidden; }             /* R2 */

/* page background: the stadium artwork, softened behind a veil, with blue hero glows */
.ap::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(52% 44% at 12% 2%, rgba(0, 136, 234, .10), transparent 60%),
    radial-gradient(44% 40% at 100% 0%, rgba(124, 58, 237, .06), transparent 55%),
    linear-gradient(rgba(245, 245, 245, .73), rgba(240, 246, 252, .68)),
    url(../../../../assets/images/auction/auction-bg.jpg);
  background-image:
    radial-gradient(52% 44% at 12% 2%, rgba(0, 136, 234, .10), transparent 60%),
    radial-gradient(44% 40% at 100% 0%, rgba(124, 58, 237, .06), transparent 55%),
    linear-gradient(rgba(245, 245, 245, .73), rgba(240, 246, 252, .68)),
    image-set(url(../../../../assets/images/auction/auction-bg.webp) type(image/webp), url(../../../../assets/images/auction/auction-bg.jpg) type(image/jpeg));
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center top;
  background-repeat: no-repeat; }
[data-theme="dark"] .ap::before { background-image:
    radial-gradient(52% 44% at 12% 2%, rgba(0, 136, 234, .12), transparent 60%),
    radial-gradient(44% 40% at 100% 0%, rgba(124, 58, 237, .08), transparent 55%),
    linear-gradient(rgba(8, 12, 22, .93), rgba(9, 13, 24, .95)),
    url(../../../../assets/images/auction/auction-bg.jpg);
  background-image:
    radial-gradient(52% 44% at 12% 2%, rgba(0, 136, 234, .12), transparent 60%),
    radial-gradient(44% 40% at 100% 0%, rgba(124, 58, 237, .08), transparent 55%),
    linear-gradient(rgba(8, 12, 22, .93), rgba(9, 13, 24, .95)),
    image-set(url(../../../../assets/images/auction/auction-bg.webp) type(image/webp), url(../../../../assets/images/auction/auction-bg.jpg) type(image/jpeg)); }

@keyframes ap-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ap-pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.ap { max-width: 1850px; margin: 0 auto; padding: 18px clamp(16px, 2.6vw, 34px) 20px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- header ---------- */
.ap-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; animation: ap-rise .5s var(--ap-ease) both; }
/* single-line header: LIVE AUCTION tag · back · tournament name */
.ap-top__titles { display: flex; flex-direction: row; align-items: center; gap: 12px; min-width: 0; flex-wrap: nowrap; }
.ap-top__titles .sm-back { margin: 0; float: none; flex: 0 0 auto; }
.ap-top__for { flex: 0 0 auto; }
.ap-top__for { display: inline-flex; align-items: center; gap: 8px; width: fit-content; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ap-green); background: rgba(16, 185, 129, .12); padding: 5px 13px; border-radius: 999px; }
.ap-top__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ap-green); animation: ap-pulse 1.8s ease-out infinite; }
.ap-top__name { margin: 0; font-family: var(--ap-font); font-size: clamp(22px, 2.5vw, 30px); font-weight: 800; line-height: 1.04; letter-spacing: -.02em; color: var(--color-text); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ap-top__desc { font-size: 13px; font-weight: 500; color: var(--color-text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-top__desc:empty { display: none; }

.ap-top__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ap-counts { display: flex; gap: 9px; flex-wrap: wrap; }
.ap-count { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); background: var(--ap-glass); border: 1px solid var(--ap-glass-brd); border-radius: 12px; padding: 8px 13px; box-shadow: var(--ap-glass-sh); transition: transform .25s var(--ap-ease); }
.ap-count:hover { transform: translateY(-2px); }
.ap-count svg { width: 15px; height: 15px; }
.ap-count b { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--color-text); }
.ap-count--all svg, .ap-count--all b { color: var(--ap-blue); }
.ap-count--sold svg, .ap-count--sold b { color: var(--ap-green); }
.ap-count--unsold svg, .ap-count--unsold b { color: var(--ap-red); }
.ap-count--avail svg, .ap-count--avail b { color: var(--ap-amber); }

.ap-top__tools { display: flex; align-items: center; gap: 10px; }
.ap-top__btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: var(--ap-glass); border: 1px solid var(--ap-glass-brd); border-radius: 12px; padding: 10px 17px; font-weight: 600; font-size: 13.5px; color: var(--color-text); box-shadow: var(--ap-glass-sh); transition: all .2s var(--ap-ease); }
.ap-top__btn svg { width: 16px; height: 16px; }
.ap-top__btn:hover { transform: translateY(-2px); border-color: rgba(0, 136, 234, .4); color: var(--ap-blue); }
.ap-top__btn:active { transform: translateY(0); }
.ap-top__btn--primary { background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -8px rgba(0, 136, 234, .6); }
.ap-top__btn--primary:hover { color: #fff; filter: brightness(1.05); }

/* ---------- main grid: equal-height columns filling the viewport ---------- */
.ap-grid { display: grid; grid-template-columns: 230px minmax(420px, 1fr) minmax(560px, 1.35fr); gap: 16px; align-items: stretch; height: calc(100vh - 218px); min-height: 550px; }
.ap-card { position: relative; background: var(--ap-glass); border: 1px solid var(--ap-glass-brd); border-radius: var(--ap-radius); box-shadow: var(--ap-glass-sh); min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ap-grid > * { animation: ap-rise .55s var(--ap-ease) both; }
.ap-grid > *:nth-child(1) { animation-delay: .05s; }
.ap-grid > *:nth-child(2) { animation-delay: .12s; }
.ap-grid > *:nth-child(3) { animation-delay: .19s; }

/* ===== SIDE RAIL ===== */
.ap-side { position: relative; height: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--ap-glass); border: 1px solid var(--ap-glass-brd); border-radius: var(--ap-radius); box-shadow: var(--ap-glass-sh); padding: 13px; overflow: hidden; }
.ap-side__label { display: flex; align-items: center; gap: 8px; padding: 4px 13px 9px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-subtle); flex: 0 0 auto; }
.ap-side__label-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ap-green); flex: 0 0 auto; animation: ap-pulse 1.8s ease-out infinite; }
.ap-side__nav { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.ap-navitem { display: flex; align-items: center; gap: 11px; width: 100%; cursor: pointer; border: 1px solid transparent; background: none; border-radius: 12px; padding: 11px 13px; font-weight: 600; font-size: 13.5px; color: var(--color-text-muted); text-align: left; transition: all .2s var(--ap-ease); }
.ap-navitem svg { width: 18px; height: 18px; flex: 0 0 auto; transition: transform .2s var(--ap-ease); }
.ap-navitem:hover { background: var(--ap-blue-soft); color: var(--ap-blue); }
.ap-navitem:hover svg { transform: scale(1.12); }
.ap-navitem.is-active { background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); color: #fff; box-shadow: 0 10px 22px -10px rgba(0, 136, 234, .7); }
.ap-navitem.is-active::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2.4px solid currentColor; border-top: 2.4px solid currentColor; transform: rotate(45deg); flex: 0 0 auto; }
/* brand footer: the stadium image fades (morphs) up into the panel, no hard box */
.ap-side__brand { position: relative; overflow: hidden; display: flex; align-items: flex-end; gap: 12px; margin: auto -13px -13px; padding: 34px 15px 15px; border-radius: 0 0 var(--ap-radius) var(--ap-radius); color: #fff; flex: 0 0 auto; min-height: 150px; }
.ap-side__brand::before { content: ""; position: absolute; inset: 0; z-index: 0; background-image: url(../../../../assets/images/auction/brand-bg.jpg); background-size: cover; background-position: center 60%;
  -webkit-mask-image: linear-gradient(to top, #000 22%, rgba(0, 0, 0, .6) 50%, rgba(0, 0, 0, .18) 78%, transparent 100%);
  mask-image: linear-gradient(to top, #000 22%, rgba(0, 0, 0, .6) 50%, rgba(0, 0, 0, .18) 78%, transparent 100%); }
.ap-side__brand::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(to top, rgba(0, 72, 140, .78), rgba(0, 54, 110, 0) 46%, rgba(0, 48, 100, 0) 72%, transparent 92%); }
.ap-side__brand > * { position: relative; z-index: 1; }
.ap-side__brand svg { width: 28px; height: 28px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.ap-side__brand-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-side__brand-nm { font-family: var(--ap-font); font-size: 14px; font-weight: 800; line-height: 1.2; text-transform: capitalize; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ap-side__brand-desc { font-size: 10.5px; font-weight: 500; line-height: 1.25; color: rgba(255, 255, 255, .85); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ap-side__brand-desc:empty { display: none; }

/* ===== CENTER · current auction ===== */
/* content stays compact; the remaining height is shared as even breathing room
   between the blocks (space-between) so nothing is stretched or gappy */
.ap-stage { gap: 10px; padding: 14px 18px 16px; overflow-y: auto; overflow-x: hidden; }
/* when the window is short, let each card scroll internally so every control stays reachable */
.ap-stage::-webkit-scrollbar, .ap-board::-webkit-scrollbar { width: 7px; }
.ap-stage::-webkit-scrollbar-thumb, .ap-board::-webkit-scrollbar-thumb { background: var(--ap-glass-brd); border-radius: 999px; }
.ap-stage { scrollbar-width: thin; }
.ap-stage__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.ap-stage__ht { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-left: 12px; }
.ap-stage__ht::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3.5px; border-radius: 999px; background: linear-gradient(180deg, #38a9f7, var(--ap-blue)); box-shadow: 0 0 10px rgba(0, 136, 234, .5); }
.ap-stage__sub { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
.ap-stage__title { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-family: var(--ap-font); font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--color-text); }
.ap-stage__title svg { width: 17px; height: 17px; color: var(--ap-blue); }
.ap-stage__counter { font-size: 12.5px; font-weight: 700; color: var(--ap-blue); font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--ap-blue-soft); border: 1px solid rgba(0, 136, 234, .22); border-radius: 999px; padding: 5px 14px; }
/* Jump-to-token input — full-width bar above the action buttons */
.ap-jump { display: flex; align-items: center; gap: 8px; width: 100%; height: 46px; padding: 0 6px 0 16px; background: var(--color-surface); border: 1px solid var(--ap-glass-brd); border-radius: var(--ap-radius-sm); box-shadow: 0 6px 18px -14px rgba(15, 23, 42, .4); transition: border-color .2s var(--ap-ease), box-shadow .2s var(--ap-ease); }
.ap-jump:focus-within { border-color: rgba(0, 136, 234, .5); box-shadow: 0 0 0 3px rgba(0, 136, 234, .12); }
.ap-jump__hash { font-size: 16px; font-weight: 800; color: var(--ap-blue); opacity: .75; flex: 0 0 auto; }
.ap-jump__input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--color-text); -moz-appearance: textfield; }
.ap-jump__input::-webkit-outer-spin-button, .ap-jump__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ap-jump__input::placeholder { color: var(--color-text-subtle); font-weight: 500; }
.ap-jump__go { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; height: 34px; padding: 0 16px; border: none; cursor: pointer; border-radius: calc(var(--ap-radius-sm) - 4px); color: #fff; font: inherit; font-size: 13px; font-weight: 700; background: linear-gradient(145deg, #2f9bf0, #0a74d6); box-shadow: 0 6px 14px -5px rgba(10, 116, 214, .6); transition: transform .15s var(--ap-ease), filter .15s var(--ap-ease); }
.ap-jump__go:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ap-jump__go svg { width: 15px; height: 15px; }

/* fixed-height player block → a long name that wraps NEVER shifts the bids,
   leading row or action buttons below it */
.ap-cur { display: flex; gap: 15px; align-items: stretch; flex: 0 0 auto; height: 188px; }
.ap-cur__photo-wrap { position: relative; width: 190px; flex: 0 0 190px; height: 100%; border-radius: var(--ap-radius-sm); overflow: hidden; background: var(--ap-inset); border: 1px solid var(--ap-glass-brd); box-shadow: 0 10px 24px -16px rgba(15, 23, 42, .45); }
/* cover (not contain) so the photo fills the whole frame, with a zoom cursor */
.ap-cur__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; background: var(--ap-inset); cursor: zoom-in; }
.ap-cur__photo-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-cur__photo[hidden] { display: none; }
.ap-cur__photo-ph { display: grid; place-items: center; color: var(--color-text-subtle); }
.ap-cur__photo-ph svg { width: 46px; height: 46px; }

/* SOLD / UNSOLD corner ribbon on the current-auction photo (projector style) */
.ap-cur__stamp { position: absolute; top: 0; left: 0; width: 118px; height: 118px; overflow: hidden; pointer-events: none; z-index: 3; }
.ap-cur__stamp[hidden] { display: none; }
.ap-cur__stamp span { position: absolute; left: -42px; top: 24px; width: 164px; padding: 6px 0; text-align: center; font-size: 12px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: #fff; transform: rotate(-45deg); box-shadow: 0 4px 12px rgba(0, 0, 0, .28); animation: ap-stamp-in .35s var(--ap-ease); }
.ap-cur__stamp.is-sold span { background: linear-gradient(90deg, #15934a, #1fbf63, #15934a); }
.ap-cur__stamp.is-unsold span { background: linear-gradient(90deg, #b91c1c, #ef4444, #b91c1c); }
@keyframes ap-stamp-in { from { opacity: 0; transform: rotate(-45deg) scale(.7); } to { opacity: 1; transform: rotate(-45deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .ap-cur__stamp span { animation: none; } }

/* Full-screen image viewer (tap the player photo to maximize it) */
.ap-imgzoom { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5, 10, 20, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: zoom-out; }
.ap-imgzoom.is-open { display: flex; animation: ap-pop .2s var(--ap-ease); }
.ap-imgzoom__img { max-width: 92vw; max-height: 92vh; border-radius: 14px; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); background: #0b1220; }
.ap-imgzoom__close { position: fixed; top: 18px; right: 20px; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.ap-imgzoom__close:hover { background: rgba(255, 255, 255, .28); }
/* image loading hint — tells the user a photo is on its way (slow networks) */
.ap-cur__loading { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 7px; pointer-events: none; }
.ap-cur__loading[hidden] { display: none; }
.ap-cur__loading-tx { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; padding: 3px 10px 3px 7px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .3); }
.ap-spinner { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; border: 2px solid rgba(0, 136, 234, .25); border-top-color: var(--ap-blue); animation: ap-spin .7s linear infinite; }
@keyframes ap-spin { to { transform: rotate(360deg); } }
.ap-cur__fav { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: none; background: rgba(15, 23, 42, .42); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); transition: transform .2s var(--ap-ease); }
.ap-cur__fav:hover { transform: scale(1.1); }
.ap-cur__fav svg { width: 15px; height: 15px; }
.ap-cur__fav.is-on svg { fill: #fff; }
.ap-cur__fav[hidden] { display: none; }

.ap-cur__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ap-cur__head2 { min-width: 0; }
/* name + city sit together at the top; the badge floats top-right so the name
   wraps around it with no reserved gap, and clips at 2 lines so it can't push
   anything down */
.ap-cur__namerow { display: block; max-height: 45px; overflow: hidden; }
.ap-cur__name { display: block; margin: 0; font-family: var(--ap-font); font-size: 18px; font-weight: 800; line-height: 1.22; letter-spacing: -.015em; color: var(--color-text); text-transform: capitalize; }
.ap-cur__badge { float: right; display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 0 10px; font-size: 10px; line-height: 1.2; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--ap-blue-soft); color: var(--ap-blue); white-space: nowrap; }
.ap-cur__badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ap-cur__badge.is-sold { background: rgba(16, 185, 129, .14); color: var(--ap-green); }
.ap-cur__badge.is-unsold { background: rgba(239, 68, 68, .14); color: var(--ap-red); }
.ap-cur__badge[hidden] { display: none; }
.ap-cur__loc { margin-top: 5px; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--color-text-muted); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ap-cur__loc::before { content: ""; width: 13px; height: 13px; flex: 0 0 auto; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center/contain no-repeat; }
.ap-cur__pills { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; flex: 0 0 auto; }
.ap-pill { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--ap-glass-brd); background: var(--ap-inset); min-width: 0; transition: transform .2s var(--ap-ease), border-color .2s var(--ap-ease); }
.ap-pill:hover { transform: translateY(-2px); border-color: rgba(0, 136, 234, .3); }
.ap-pill__ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: #f0f9ff; border: 1px solid #e0f2fe; color: #0088ea; transition: transform .25s var(--ap-ease); }
[data-theme="dark"] .ap-pill__ico { background: rgba(0, 136, 234, .15); border-color: rgba(0, 136, 234, .22); color: #60a5fa; }
.ap-pill:hover .ap-pill__ico { transform: scale(1.08); }
.ap-pill__ico svg { width: 16px; height: 16px; }
.ap-pill__tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ap-pill__k { font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-subtle); white-space: nowrap; }
.ap-pill__v { font-size: 12.5px; font-weight: 700; color: var(--color-text); text-transform: capitalize; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: normal; overflow-wrap: break-word; }

.ap-cur__bids { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; flex: 0 0 auto; }
.ap-bidtile { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--ap-glass-brd); background: var(--color-surface); min-width: 0; }
[data-theme="dark"] .ap-bidtile { background: var(--ap-inset); }
.ap-bidtile__ico { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: #f0f9ff; border: 1px solid #e0f2fe; color: #0088ea; }
[data-theme="dark"] .ap-bidtile__ico { background: rgba(0, 136, 234, .15); border-color: rgba(0, 136, 234, .22); color: #60a5fa; }
.ap-bidtile__ico svg { width: 18px; height: 18px; }
.ap-bidtile__tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-bidtile__k { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-subtle); }
.ap-bidtile__v { font-family: var(--ap-font); font-size: 20px; font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.ap-bidtile--cur { background: linear-gradient(135deg, #f0f9ff, #e1f1fe); border-color: rgba(0, 136, 234, .26); }
[data-theme="dark"] .ap-bidtile--cur { background: linear-gradient(135deg, rgba(0, 136, 234, .18), rgba(0, 136, 234, .07)); border-color: rgba(0, 136, 234, .32); }
.ap-bidtile--cur .ap-bidtile__ico { background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); border-color: transparent; color: #fff; box-shadow: 0 5px 12px -5px rgba(0, 136, 234, .7); }
.ap-bidtile--cur .ap-bidtile__v { color: var(--ap-blue); }

/* leading-team showcase — grows to fill the space between the bids and the
   action buttons so there is no unwanted gap; content stays centred */
.ap-cur__lead { flex: 0 0 auto; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 14px 16px; border-radius: var(--ap-radius-sm); background: var(--color-surface); border: 1px solid var(--ap-glass-brd); position: relative; overflow: hidden; transition: border-color .25s var(--ap-ease), background .25s var(--ap-ease); }
.ap-cur__lead::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--color-border); transition: background .25s var(--ap-ease); }
.ap-cur__lead.is-active { background: linear-gradient(135deg, rgba(16, 185, 129, .085), rgba(16, 185, 129, .015)); border-color: rgba(16, 185, 129, .32); }
.ap-cur__lead.is-active::before { background: linear-gradient(to bottom, var(--ap-green), #059669); }
.ap-cur__lead-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ap-cur__lead-ico { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; background: rgba(16, 185, 129, .14); color: var(--ap-green); }
.ap-cur__lead-ico svg { width: 15px; height: 15px; }
.ap-cur__lead-k { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-subtle); }
.ap-cur__lead-badge { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ap-green); background: rgba(16, 185, 129, .13); border: 1px solid rgba(16, 185, 129, .3); padding: 3px 9px; border-radius: 999px; }
.ap-cur__lead-badge[hidden] { display: none; }
.ap-cur__lead-main { flex: 0 0 auto; display: flex; align-items: center; gap: 16px; min-height: 0; }
.ap-cur__lead-avatar { width: 52px; height: 52px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center; background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text-subtle); overflow: hidden; }
.ap-cur__lead-avatar.has-logo { border-color: rgba(16, 185, 129, .32); box-shadow: 0 6px 18px -7px rgba(16, 185, 129, .55); }
.ap-cur__lead-logo { width: 100%; height: 100%; object-fit: cover; }
.ap-cur__lead-logo[hidden] { display: none; }
.ap-cur__lead-fallback { width: 28px; height: 28px; }
.ap-cur__lead-avatar.has-logo .ap-cur__lead-fallback { display: none; }
.ap-cur__lead-tx { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ap-cur__lead-team { font-family: var(--ap-font); font-size: 20px; font-weight: 800; line-height: 1.12; color: var(--color-text); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-cur__lead-amt { font-size: 13px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-cur__lead.is-active .ap-cur__lead-amt { color: var(--ap-green); font-weight: 700; }

/* smooth, tactile buttons — same recipe as the live-scoring keypad:
   soft 135deg tint gradient + hairline tinted border + colored text +
   low shadow with inset top highlight, hover lifts into a soft colored glow */
/* both button rows kept together as one tight group (no stretched gap between) */
.ap-cur__btns { display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.ap-cur__acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 0 0 auto; }
.ap-abtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1.5px solid #e2e8f0; border-radius: 14px; padding: 13px 10px; font-weight: 800; font-size: 14px; letter-spacing: .005em; color: var(--color-text); background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, .05), inset 0 1px 0 #fff; transition: all .22s var(--ap-ease); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ap-abtn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.ap-abtn:hover:not(:disabled) { transform: translateY(-1px); }
.ap-abtn:active:not(:disabled) { transform: scale(.98); }
.ap-abtn:disabled { opacity: .45; filter: grayscale(.35); cursor: not-allowed; }
.ap-abtn--sold { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #86efac; color: #15803d; box-shadow: 0 4px 14px rgba(22, 163, 74, .15), inset 0 1px 0 #fff; }
.ap-abtn--sold:hover:not(:disabled) { border-color: #34d399; box-shadow: 0 12px 28px -6px rgba(16, 185, 129, .32), inset 0 1px 0 #fff; }
.ap-abtn--unsold { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fecaca; color: #b91c1c; box-shadow: 0 4px 14px rgba(239, 68, 68, .15), inset 0 1px 0 #fff; }
.ap-abtn--unsold:hover:not(:disabled) { border-color: #f87171; box-shadow: 0 12px 28px -6px rgba(239, 68, 68, .3), inset 0 1px 0 #fff; }
.ap-abtn--undo { background: linear-gradient(135deg, #fffbe6, #fef3c7); border-color: #fde68a; color: #b45309; box-shadow: 0 4px 14px rgba(245, 158, 11, .16), inset 0 1px 0 #fff; }
.ap-abtn--undo:hover:not(:disabled) { border-color: #fbbf24; box-shadow: 0 12px 28px -6px rgba(245, 158, 11, .32), inset 0 1px 0 #fff; }
.ap-cur__acts--sub .ap-abtn { font-size: 12.5px; padding: 12px 8px; gap: 6px; }
.ap-cur__acts--sub .ap-abtn svg { width: 15px; height: 15px; }
.ap-abtn--ghost { background: #fff; color: var(--color-text); border-color: #e2e8f0; font-weight: 700; }
.ap-abtn--ghost:hover:not(:disabled) { border-color: #cbd5e1; color: var(--ap-blue); box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .14), inset 0 1px 0 #fff; }
/* dark-mode button tints */
[data-theme="dark"] .ap-abtn { background: var(--ap-inset); border-color: var(--ap-glass-brd); color: var(--color-text); box-shadow: none; }
[data-theme="dark"] .ap-abtn--sold { background: linear-gradient(135deg, rgba(16, 185, 129, .2), rgba(16, 185, 129, .08)); border-color: rgba(16, 185, 129, .45); color: #34d399; }
[data-theme="dark"] .ap-abtn--sold:hover:not(:disabled) { box-shadow: 0 12px 28px -8px rgba(16, 185, 129, .4); }
[data-theme="dark"] .ap-abtn--unsold { background: linear-gradient(135deg, rgba(239, 68, 68, .2), rgba(239, 68, 68, .08)); border-color: rgba(239, 68, 68, .45); color: #f87171; }
[data-theme="dark"] .ap-abtn--unsold:hover:not(:disabled) { box-shadow: 0 12px 28px -8px rgba(239, 68, 68, .4); }
[data-theme="dark"] .ap-abtn--undo { background: linear-gradient(135deg, rgba(245, 158, 11, .2), rgba(245, 158, 11, .08)); border-color: rgba(245, 158, 11, .45); color: #fbbf24; }
[data-theme="dark"] .ap-abtn--undo:hover:not(:disabled) { box-shadow: 0 12px 28px -8px rgba(245, 158, 11, .4); }
[data-theme="dark"] .ap-abtn--ghost { background: var(--ap-inset); border-color: var(--ap-glass-brd); color: var(--color-text-muted); }
[data-theme="dark"] .ap-abtn--ghost:hover:not(:disabled) { border-color: rgba(0, 136, 234, .4); color: var(--ap-blue); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .4); }

/* ===== RIGHT · live bidding board ===== */
.ap-board { gap: 14px; padding: 15px 17px 16px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.ap-board__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.ap-board__ht { position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-left: 12px; }
.ap-board__ht::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3.5px; border-radius: 999px; background: linear-gradient(180deg, #38a9f7, var(--ap-blue)); box-shadow: 0 0 10px rgba(0, 136, 234, .5); }
.ap-board__title { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-family: var(--ap-font); font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--color-text); }
.ap-board__title svg { width: 17px; height: 17px; color: var(--ap-blue); }
.ap-board__hint { margin: 0; font-size: 12px; color: var(--color-text-muted); font-weight: 500; }
.ap-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ap-green); background: rgba(16, 185, 129, .12); padding: 5px 12px; border-radius: 999px; flex: 0 0 auto; }
.ap-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ap-green); animation: ap-pulse 1.8s ease-out infinite; }

.ap-tblwrap { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 300px); border: 1px solid var(--ap-glass-brd); border-radius: var(--ap-radius-sm); overflow: auto; background: var(--ap-inset); }
.ap-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ap-tbl thead th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 11px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--color-text-subtle); background: var(--color-surface-2); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.ap-tbl__r { text-align: right; }
.ap-tbl tbody td { padding: 7px 10px; border-bottom: 1px solid var(--color-border); color: var(--color-text); vertical-align: middle; white-space: nowrap; font-size: 12.5px; }
.ap-tbl tbody tr:last-child td { border-bottom: 0; }
.ap-tbl__team { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ap-tbl__logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ap-blue); overflow: hidden; }
.ap-tbl__nm { font-weight: 700; color: var(--color-text); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; }
.ap-tbl__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ap-tbl__bal { text-align: right; font-weight: 800; color: var(--ap-green); font-variant-numeric: tabular-nums; }
.ap-tbl__loading td { padding: 0 !important; }

/* Live Bidding Board: centre the numeric columns (header + data) so the
   values sit under the middle of each column instead of hugging the right. */
.ap-tbl--bid thead th.ap-tbl__r { text-align: center; }
.ap-tbl--bid tbody td.ap-tbl__val,
.ap-tbl--bid tbody td.ap-tbl__bal { text-align: center; }

/* clickable bid rows — leading team: soft contained green, left accent */
.ap-tbl--bid tbody tr { cursor: pointer; transition: background .15s var(--ap-ease); }
.ap-tbl--bid tbody tr:hover td { background: var(--ap-blue-soft); }
.ap-tbl--bid tbody tr:active td { background: rgba(0, 136, 234, .14); }
.ap-tbl--bid tbody tr.is-leading td { background: rgba(16, 185, 129, .18); }
.ap-tbl--bid tbody tr.is-leading td:first-child { box-shadow: inset 5px 0 0 var(--ap-green); }
/* keep the SAME weight as a normal row (700) when a team becomes leading —
   switching to 800 changed the name's rendered width, so the text visibly
   jiggled left/right as the highlight moved between short and long names.
   The green colour + stronger row background + left strip mark it clearly
   without any layout shift. */
.ap-tbl--bid tbody tr.is-leading .ap-tbl__nm { color: var(--ap-green); }
.ap-tbl--bid tbody tr.is-leading:hover td { background: rgba(16, 185, 129, .24); }
/* Team whose bid limit is over (balance/max bid exhausted): clear RED
   highlight so the scorer sees at a glance it can no longer bid. */
.ap-tbl--bid tbody tr.is-out { cursor: not-allowed; opacity: .92; }
.ap-tbl--bid tbody tr.is-out td { background: rgba(239, 68, 68, .14); }
.ap-tbl--bid tbody tr.is-out td:first-child { box-shadow: inset 5px 0 0 var(--ap-red); }
.ap-tbl--bid tbody tr.is-out:hover td { background: rgba(239, 68, 68, .14); }
.ap-tbl--bid tbody tr.is-out .ap-tbl__nm { color: var(--ap-red); }
.ap-tbl--bid tbody tr.is-out .ap-tbl__bal { color: var(--ap-red); }
.ap-tbl--bid tbody tr.ap-tbl__loading { cursor: default; }
.ap-tbl--bid tbody tr.ap-tbl__loading:hover td { background: transparent; }
.ap-tbl--bid.is-locked tbody tr { cursor: default; }
.ap-tbl--bid.is-locked tbody tr:hover td, .ap-tbl--bid.is-locked tbody tr:active td { background: transparent; }
.ap-tbl--bid.is-locked tbody tr.is-leading td { background: rgba(16, 185, 129, .18); }
.ap-tbl--bid.is-locked tbody tr:not(.is-leading) { opacity: .7; }

/* ---------- empty / spinner ---------- */
.ap-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 40px 16px; color: var(--color-text-muted); font-size: 13.5px; font-weight: 500; text-align: center; height: 100%; }
.ap-empty__spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--color-border); border-top-color: var(--ap-blue); animation: ap-spin .8s linear infinite; }

/* ---------- modals (match the site's standard modal: solid card, radius 12,
   white/blur overlay, close pinned top-right) ---------- */
.ap-modal-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px 16px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
[data-theme="dark"] .ap-modal-overlay { background: rgba(2, 6, 23, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ap-modal-overlay.is-open { display: flex; }
.ap-modal { position: relative; width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column; background: var(--color-surface); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); overflow: hidden; animation: ap-pop .28s var(--ap-ease); }
[data-theme="dark"] .ap-modal { border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.ap-modal--wide { max-width: 900px; }
/* Players modal: near-full-screen so the player cards have room to breathe. */
#ap-pick-overlay .ap-modal { max-width: 96vw; width: 96vw; max-height: 94vh; }
/* Settings modal: wider + 2-column toggles so it isn't a tall narrow strip. */
#ap-settings-overlay .ap-modal { max-width: 720px; }
.ap-set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; }
.ap-set-grid .ap-set-toggle { padding: 12px 0; }
@media (max-width: 580px) { .ap-set-grid { grid-template-columns: 1fr; } }
.ap-modal--confirm { max-width: 396px; }
.ap-confirm { padding: 28px 26px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 11px; }
.ap-confirm__ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(239, 68, 68, .12); color: var(--ap-red); }
.ap-confirm__ico svg { width: 28px; height: 28px; }
.ap-confirm__title { margin: 3px 0 0; font-family: var(--ap-font); font-size: 19px; font-weight: 800; color: var(--color-text); }
.ap-confirm__msg { margin: 0; font-size: 13.5px; color: var(--color-text-muted); line-height: 1.5; }
.ap-confirm__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; width: 100%; margin-top: 10px; }
.ap-confirm__acts .ap-abtn { padding: 12px; font-size: 14px; }
/* confirm Cancel: calm, smooth hover (match create-tournament ghost, no blue lift) */
.ap-confirm__acts .ap-abtn--ghost { border-color: var(--color-border-strong); color: var(--color-text-muted); font-weight: 700; box-shadow: none; }
.ap-confirm__acts .ap-abtn--ghost:hover:not(:disabled) { background: var(--color-surface-hover); border-color: var(--color-border-strong); color: var(--color-text); box-shadow: none; transform: none; }
.ap-cbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; border: none; border-radius: 13px; padding: 12px; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(135deg, #f87171, var(--ap-red)); box-shadow: 0 9px 20px -9px rgba(239, 68, 68, .75); transition: all .2s var(--ap-ease); }
.ap-cbtn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ap-cbtn:active { transform: scale(.98); }
@keyframes ap-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.ap-modal__head { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--color-border); }
.ap-modal__headtop { display: flex; align-items: center; gap: 12px; }
.ap-modal__title { margin: 0; font-family: var(--ap-font); font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--color-text); margin-right: auto; padding-right: 36px; }
.ap-modal__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-chip { cursor: pointer; border: 1px solid var(--color-border); background: var(--ap-inset); border-radius: 999px; padding: 7px 15px; font-weight: 600; font-size: 12.5px; color: var(--color-text-muted); transition: all .18s var(--ap-ease); }
.ap-chip:hover { color: var(--color-text); border-color: rgba(0, 136, 234, .35); }
.ap-chip.is-on { background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 136, 234, .6); }
.ap-modal__close { position: absolute; top: 13px; right: 13px; z-index: 5; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; flex: 0 0 auto; border: 1px solid var(--color-border); background: var(--ap-inset); font-size: 22px; line-height: 1; color: var(--color-text-muted); transition: all .18s var(--ap-ease); }
.ap-modal__close:hover { background: var(--color-surface-hover); color: var(--color-text); border-color: var(--color-border-strong); }
.ap-modal__search { display: flex; align-items: center; gap: 9px; background: var(--ap-inset); border: 1px solid var(--color-border); border-radius: 12px; padding: 0 12px; transition: all .18s var(--ap-ease); }
.ap-modal__search:focus-within { border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(0, 136, 234, .15); }
.ap-modal__search svg { width: 17px; height: 17px; color: var(--color-text-subtle); flex: 0 0 auto; }
.ap-modal__search input { flex: 1 1 auto; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 14px; color: var(--color-text); padding: 11px 0; }
.ap-modal__search-clear { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; cursor: pointer; border: none; background: var(--color-border); color: var(--color-text-muted); font-size: 16px; line-height: 1; }
.ap-modal__search-clear[hidden] { display: none; }
.ap-modal__body { padding: 18px 20px 22px; overflow-y: auto; }
.ap-modal--wide .ap-modal__body { height: clamp(360px, 62vh, 600px); }
#ap-pick-overlay .ap-modal__body { height: calc(94vh - 150px); min-height: 360px; }
.ap-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; align-content: start; }
.ap-pool > .ap-empty { grid-column: 1 / -1; width: 100%; min-height: 42vh; }

/* Player cards — identical layout to the auction-details page player card
   (form badge + status badge, round avatar, name, role, batting/bowling stats,
   city · age, and a coloured base/sold box at the bottom). */
.ap-pool-pick.player-card { background: #ffffff; border-radius: 24px; overflow: hidden; box-shadow: 0 8px 30px rgba(0, 0, 0, .04); position: relative; border: none; transition: all .2s ease-in-out; display: flex; flex-direction: column; cursor: pointer; }
.ap-pool-pick.player-card:hover { transform: translateY(-6px); box-shadow: 0 12px 35px rgba(0, 0, 0, .08); }
.ap-pool-pick .player-card-body { padding: 22px 22px 0; display: flex; flex-direction: column; align-items: center; flex: 1; }
.ap-pool-pick .player-card-top-bar { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.ap-pool-pick .player-form-badge { background: #0b8005; color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 14px; font-weight: 800; }
.ap-pool-pick .player-status-badge { font-size: 12px; font-weight: 800; padding: 6px 14px; border-radius: 20px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.ap-pool-pick .status-dot { width: 5px; height: 5px; border-radius: 50%; }
.ap-pool-pick .player-avatar-container { width: 90px; height: 90px; border-radius: 50%; box-shadow: 0 4px 15px rgba(0, 0, 0, .08); background: #fff; margin-bottom: 16px; }
.ap-pool-pick .player-avatar-img { width: 100%; height: 100%; border-radius: 50%; border: 4px solid #fff; object-fit: cover; background-color: #f8fafc; }
.ap-pool-pick .player-avatar-img.ap-pool-ph { display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #0088ea; background: #eff6ff; }
.ap-pool-pick .player-card-name { font-size: 18px; font-weight: 900; color: #041e42; text-align: center; margin: 0 0 8px; text-transform: uppercase; width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; line-height: 1.2; }
.ap-pool-pick .player-card-role-container { margin-bottom: 20px; text-align: center; }
.ap-pool-pick .player-card-role { background: #dcfce7; color: #16a34a; padding: 4px 16px; border-radius: 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; display: inline-block; }
.ap-pool-pick .player-stats-grid { display: flex; width: 100%; justify-content: center; gap: 24px; margin-bottom: 20px; }
.ap-pool-pick .player-stat-col { text-align: center; flex: 1; }
.ap-pool-pick .player-stat-label { font-size: 13px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.ap-pool-pick .player-stat-value { font-size: 14px; font-weight: 800; color: #000; text-transform: capitalize; line-height: 1.4; min-height: 2.8em; display: flex; align-items: center; justify-content: center; }
.ap-pool-pick .player-stat-divider { width: 1px; background: #e2e8f0; }
.ap-pool-pick .player-card-footer-info { width: 100%; display: flex; justify-content: center; gap: 16px; align-items: center; margin-top: auto; margin-bottom: 18px; }
.ap-pool-pick .player-card-city { font-size: 14px; font-weight: 700; color: #475569; display: flex; align-items: center; gap: 6px; }
.ap-pool-pick .player-card-dot { width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; }
.ap-pool-pick .player-card-age { font-size: 14px; color: #475569; font-weight: 600; }
.ap-pool-pick .player-card-bottom-box { width: 100%; border-radius: 12px; padding: 12px 14px; display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 20px; min-height: 48px; }
.ap-pool-pick .player-card-bottom-text { font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; text-align: center; width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; word-break: break-word; }

/* Dark theme: keep every piece of text readable on the dark card. */
[data-theme="dark"] .ap-pool-pick.player-card { background: #0f1b2d; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
[data-theme="dark"] .ap-pool-pick .player-card-name { color: #e6edf6; }
[data-theme="dark"] .ap-pool-pick .player-avatar-container { background: #0f1b2d; }
[data-theme="dark"] .ap-pool-pick .player-avatar-img { border-color: #0f1b2d; background-color: #16233a; }
[data-theme="dark"] .ap-pool-pick .player-stat-value { color: #e6edf6; }
[data-theme="dark"] .ap-pool-pick .player-stat-label { color: #9fb0c3; }
[data-theme="dark"] .ap-pool-pick .player-stat-divider { background: rgba(148, 163, 184, .25); }
[data-theme="dark"] .ap-pool-pick .player-card-city, [data-theme="dark"] .ap-pool-pick .player-card-age { color: #c2cfdd; }
[data-theme="dark"] .ap-pool-pick .player-card-dot { background: #44566b; }

.ap-teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; }
.ap-teamgrid__card { border: 1px solid var(--color-border); border-radius: var(--ap-radius-sm); background: var(--ap-inset); padding: 15px; display: flex; align-items: center; gap: 12px; transition: all .2s var(--ap-ease); }
.ap-teamgrid__card:hover { transform: translateY(-2px); border-color: rgba(0, 136, 234, .35); }
.ap-teamgrid__logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); }
.ap-teamgrid__nm { font-size: 13.5px; font-weight: 700; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.ap-teamgrid__sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }

/* statistics */
.ap-statsbox { display: flex; flex-direction: column; gap: 10px; }
.ap-statrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-radius: var(--ap-radius-sm); border: 1px solid var(--color-border); background: var(--ap-inset); }
.ap-statrow__k { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.ap-statrow__v { font-family: var(--ap-font); font-size: 15px; font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; text-align: right; }
.ap-statrow__v.is-green { color: var(--ap-green); }
.ap-statrow__v small { display: block; font-size: 11px; font-weight: 500; color: var(--color-text-muted); margin-top: 1px; }

/* settings */
.ap-set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }
.ap-set-block { display: flex; flex-direction: column; gap: 11px; padding: 2px 0; }
.ap-set-row__tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-set-row__tx b { font-size: 14.5px; font-weight: 700; color: var(--color-text); }
.ap-set-row__tx small { font-size: 12.5px; color: var(--color-text-muted); }
.ap-set-divider { height: 1px; background: var(--color-border); margin: 14px 0; }
/* toggle rows + switch */
.ap-set-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; }
.ap-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px; cursor: pointer; border: 1px solid var(--color-border-strong); background: var(--color-surface-2); padding: 0; transition: background .2s var(--ap-ease), border-color .2s var(--ap-ease); }
.ap-switch__dot { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15, 23, 42, .25); transition: transform .22s var(--ap-ease); }
.ap-switch.is-on { background: linear-gradient(135deg, #38a9f7, var(--ap-blue)); border-color: var(--ap-blue); }
.ap-switch.is-on .ap-switch__dot { transform: translateX(20px); }
.ap-switch:hover:not(.is-on) { border-color: var(--ap-blue); }
[data-theme="dark"] .ap-switch__dot { background: #e2e8f0; }
/* stacked setting block (label on top, control row below → nothing wraps) */
.ap-set-stack { display: flex; flex-direction: column; gap: 11px; padding: 4px 0; }
/* reset-team custom dropdown + button */
.ap-set-teamreset { display: flex; align-items: flex-start; gap: 10px; }
.ap-set-teamreset .ap-dbtn { flex: 0 0 auto; height: 46px; padding: 0 18px; border-radius: 12px; }
.ap-dbtn--block { width: 100%; justify-content: center; padding: 13px; border-radius: 12px; }
.ap-dbtn:disabled { opacity: .5; cursor: not-allowed; }
.ap-dbtn:disabled:hover { border-color: #fecaca; box-shadow: 0 4px 14px rgba(239, 68, 68, .14), inset 0 1px 0 #fff; }
/* custom dropdown (matches site UI; native <select> options can't be styled) */
.ap-dd { position: relative; flex: 1 1 auto; min-width: 0; }
.ap-dd__btn { width: 100%; height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 12px; border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); font-family: var(--ap-font); font-size: 14px; font-weight: 600; padding: 0 12px 0 14px; cursor: pointer; transition: border-color .18s var(--ap-ease), box-shadow .18s var(--ap-ease); }
.ap-dd__btn:hover { border-color: var(--ap-blue); }
.ap-dd.is-open .ap-dd__btn { border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(0, 136, 234, .15); }
.ap-dd__val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ap-dd__val.is-placeholder { color: var(--color-text-subtle); font-weight: 500; }
.ap-dd__chev { width: 16px; height: 16px; flex: 0 0 auto; color: var(--color-text-subtle); transition: transform .2s var(--ap-ease); }
.ap-dd.is-open .ap-dd__chev { transform: rotate(180deg); }
/* open UPWARD as an overlay so the list never adds height to the scrolling modal
   body (no unwanted space / scrollbar when the team dropdown is opened) */
.ap-dd__panel { display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 7px); z-index: 50; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-2); box-shadow: 0 -12px 30px -12px rgba(15, 23, 42, .28); padding: 5px; max-height: 196px; overflow-y: auto; }
[data-theme="dark"] .ap-dd__panel { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); }
.ap-dd.is-open .ap-dd__panel { display: block; animation: ap-pop .16s var(--ap-ease); }
.ap-dd__opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer; border: none; background: none; border-radius: 9px; padding: 10px 11px; font-family: var(--ap-font); font-size: 13.5px; font-weight: 600; color: var(--color-text); transition: background .15s var(--ap-ease); }
.ap-dd__opt:hover { background: var(--color-surface-hover); }
.ap-dd__opt.is-sel { background: var(--ap-blue-soft); color: var(--ap-blue); }
.ap-dd__opt-dot { width: 24px; height: 24px; border-radius: 7px; flex: 0 0 auto; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--ap-blue-soft); color: var(--ap-blue); text-transform: uppercase; }
.ap-modebtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.ap-modebtn { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; border: 1px solid var(--color-border); background: var(--ap-inset); border-radius: var(--ap-radius-sm); padding: 14px 8px; font-weight: 700; font-size: 13px; color: var(--color-text-muted); transition: all .2s var(--ap-ease); }
.ap-modebtn svg { width: 19px; height: 19px; }
.ap-modebtn:hover { border-color: rgba(0, 136, 234, .4); color: var(--color-text); transform: translateY(-2px); }
.ap-modebtn.is-on { border-color: var(--ap-blue); background: var(--ap-blue-soft); color: var(--ap-blue); box-shadow: 0 0 0 1px var(--ap-blue) inset; }
/* proper danger button (Reset Auction) — smooth red button, clearly a button */
.ap-dbtn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; flex: 0 0 auto; border: 1.5px solid #fecaca; background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #b91c1c; border-radius: 11px; padding: 10px 18px; font-weight: 800; font-size: 13px; white-space: nowrap; box-shadow: 0 4px 14px rgba(239, 68, 68, .14), inset 0 1px 0 #fff; transition: all .2s var(--ap-ease); }
.ap-dbtn svg { width: 15px; height: 15px; }
.ap-dbtn:hover { border-color: #f87171; box-shadow: 0 11px 24px -8px rgba(239, 68, 68, .35), inset 0 1px 0 #fff; }
.ap-dbtn:active { transform: scale(.98); }
[data-theme="dark"] .ap-dbtn { background: linear-gradient(135deg, rgba(239, 68, 68, .2), rgba(239, 68, 68, .08)); border-color: rgba(239, 68, 68, .45); color: #f87171; box-shadow: none; }
[data-theme="dark"] .ap-dbtn:hover { box-shadow: 0 11px 24px -8px rgba(239, 68, 68, .4); }

/* ---------- bid logs ---------- */
.ap-logs { display: flex; flex-direction: column; gap: 14px; }
.ap-logs__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ap-logtile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--ap-radius-sm); border: 1px solid var(--color-border); background: var(--ap-inset); }
.ap-logtile--hi { background: linear-gradient(135deg, rgba(0, 136, 234, .13), rgba(0, 136, 234, .04)); border-color: rgba(0, 136, 234, .28); }
.ap-logtile__k { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--color-text-muted); }
.ap-logtile__v { font-family: var(--ap-font); font-size: 20px; font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; line-height: 1.15; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-logtile--hi .ap-logtile__v { color: var(--ap-blue); }
.ap-logtile__s { font-size: 11.5px; color: var(--color-text-muted); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-logs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-logcard { border: 1px solid var(--color-border); border-radius: var(--ap-radius-sm); background: var(--ap-inset); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ap-logcard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-logcard__title { margin: 0; font-family: var(--ap-font); font-size: 14px; font-weight: 800; color: var(--color-text); }
.ap-logcard__sub { font-size: 12px; font-weight: 600; color: var(--color-text-muted); text-transform: capitalize; }
.ap-activity { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.ap-act { display: flex; align-items: center; gap: 11px; padding: 9px 6px; border-radius: 10px; transition: background .15s var(--ap-ease); }
.ap-act:hover { background: var(--ap-blue-soft); }
.ap-act__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-subtle); flex: 0 0 auto; }
.ap-act__dot.is-now { background: var(--ap-green); animation: ap-pulse 1.8s ease-out infinite; }
.ap-act__logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ap-blue); overflow: hidden; }
.ap-act__tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; margin-right: auto; }
.ap-act__nm { font-size: 13px; font-weight: 700; color: var(--color-text); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-act__sub { font-size: 12px; color: var(--color-text-muted); }
.ap-act__sub b { color: var(--color-text); font-weight: 700; }
.ap-act__time { font-size: 11.5px; font-weight: 600; color: var(--color-text-subtle); white-space: nowrap; flex: 0 0 auto; }
/* bidding trend — modern smooth area chart */
.ap-trend { position: relative; min-height: 200px; border-radius: 12px; background: linear-gradient(180deg, rgba(16,185,129,.04), transparent 70%); display: flex; flex-direction: column; justify-content: center; padding: 6px 4px 2px; }
/* sold-price chart */
.ap-sold { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ap-sold__bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 0 2px; }
.ap-sbar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.ap-sbar__val { font-size: 9px; font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .18s var(--ap-ease); }
.ap-sbar:hover .ap-sbar__val, .ap-sbar.is-hi .ap-sbar__val { opacity: 1; }
.ap-sbar.is-hi .ap-sbar__val { color: var(--ap-green); }
.ap-sbar__col { flex: 1 1 auto; width: 100%; max-width: 30px; display: flex; align-items: flex-end; justify-content: center; }
.ap-sbar__fill { width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #34d399, #10b981); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); transition: filter .18s var(--ap-ease), transform .18s var(--ap-ease); min-height: 7px; }
.ap-sbar.is-hi .ap-sbar__fill { background: linear-gradient(180deg, #10b981, #059669); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 16px -6px rgba(16,185,129,.6); }
.ap-sbar:hover .ap-sbar__fill { filter: brightness(1.06); transform: scaleY(1.015); }
.ap-sbar__lbl { font-size: 9.5px; font-weight: 600; color: var(--color-text-subtle); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.ap-sold__meta { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.ap-sold__pill { font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; background: var(--color-surface); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--color-border); }
.ap-sold__pill--hi { color: var(--ap-green); border-color: rgba(16,185,129,.32); background: rgba(16,185,129,.08); }
.ap-sold__pill--lo { color: var(--color-text-subtle); }
/* team-wise spend — ranked bars */
.ap-teamwise { display: flex; flex-direction: column; gap: 9px; }
.ap-tw { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 12px; border: 1px solid transparent; transition: background .15s var(--ap-ease); }
.ap-tw:hover { background: var(--color-surface-2); }
.ap-tw.is-top { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.2); }
.ap-tw__rank { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--color-text-muted); background: var(--color-surface-2); border: 1px solid var(--color-border); font-variant-numeric: tabular-nums; }
.ap-tw.is-top .ap-tw__rank { color: #fff; background: linear-gradient(135deg, #34d399, var(--ap-green)); border-color: transparent; box-shadow: 0 5px 12px -5px rgba(16,185,129,.7); }
.ap-tw__logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ap-blue); overflow: hidden; }
.ap-tw__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-tw__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-tw__nm { font-size: 12.5px; font-weight: 700; color: var(--color-text); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.ap-tw__lead { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ap-green); background: rgba(16,185,129,.14); padding: 2px 7px; border-radius: 999px; flex: 0 0 auto; }
.ap-tw__amt { font-size: 13px; font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.ap-tw__bar { height: 8px; border-radius: 999px; background: var(--color-surface-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(15,23,42,.06); }
.ap-tw__bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60bdf9, var(--ap-blue)); transition: width .5s var(--ap-ease); }
.ap-tw.is-top .ap-tw__amt { color: var(--ap-green); }
.ap-tw.is-top .ap-tw__bar span { background: linear-gradient(90deg, #34d399, var(--ap-green)); }
[data-theme="dark"] .ap-tw__bar { box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }

/* ---------- responsive (R6) ---------- */
/* short windows: drop the 550px floor so the cards fit the viewport and each
   one scrolls internally (ap-stage / ap-board are overflow-y:auto) — every
   control stays reachable instead of being clipped off the bottom */
@media (max-height: 820px) {
  .ap-grid { min-height: 0; }
}
@media (max-width: 1080px) {
  .ap-grid { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .ap-side { height: auto; overflow: visible; }
  .ap-side__nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .ap-navitem { width: auto; flex: 1 1 auto; justify-content: center; }
  .ap-navitem.is-active::after { display: none; }
  .ap-side__brand { display: none; }
  .ap-stage, .ap-board { height: auto; }
  /* release the desktop fixed height so stacked content can't overlap */
  .ap-cur { flex: 0 0 auto; height: auto; }
  .ap-cur__lead { flex: 0 0 auto; }
  .ap-tblwrap { max-height: 60vh; }
}
@media (max-width: 680px) {
  .ap-logs__grid { grid-template-columns: 1fr; }
  .ap-logs__tiles { grid-template-columns: 1fr; }
  .ap-modebtns { grid-template-columns: 1fr; }
  .ap-cur__bids { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ap { padding: 16px 16px 24px; }
  .ap-top { align-items: stretch; }
  .ap-top__right { justify-content: space-between; width: 100%; }
  /* count chips: even 2x2 grid instead of a ragged 3+1 wrap */
  .ap-counts { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; width: 100%; }
  .ap-count { justify-content: space-between; }
  .ap-top__tools { flex: 1 1 100%; width: 100%; }
  .ap-top__btn { flex: 1 1 auto; justify-content: center; }
  /* side nav: neat 2-col grid, last item (Bid Logs) spans the full width */
  .ap-side__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ap-navitem { flex: none; width: 100%; justify-content: flex-start; }
  .ap-navitem:last-child { grid-column: 1 / -1; }
  .ap-stage { padding: 14px; gap: 14px; }
  /* player block stacks: photo on top (fixed, non-overlapping), info below */
  .ap-cur { flex-direction: column; height: auto; gap: 13px; }
  .ap-cur__photo-wrap { width: 100%; flex: 0 0 auto; height: 260px; min-height: 0; }
  .ap-cur__info { justify-content: flex-start; gap: 13px; }
  .ap-cur__pills { grid-template-columns: 1fr 1fr; margin-top: 0; }
  .ap-cur__bids { grid-template-columns: 1fr; }
  /* all action buttons full-width & stacked, so they line up cleanly */
  .ap-cur__acts { grid-template-columns: 1fr; }
  .ap-cur__acts--sub { grid-template-columns: 1fr; }
  .ap-cur__lead-main { gap: 13px; }
}
@media (max-width: 380px) {
  .ap-cur__pills { grid-template-columns: 1fr; }
  .ap-bidtile__v { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .ap-top__dot, .ap-live__dot, .ap-act__dot.is-now { animation: none; } .ap-grid > *, .ap-top { animation: none; } }

/* ============================================================
   Quick Jump (bid step selector) + per-team custom bid
   ============================================================ */
.ap-quickjump { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; flex-wrap: wrap; }
.ap-quickjump__lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted); }
.ap-quickjump__lbl svg { width: 15px; height: 15px; color: var(--ap-blue); }
.ap-quickjump__chips { display: flex; gap: 7px; flex-wrap: wrap; }
.ap-qjchip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--ap-glass-brd); background: var(--ap-glass); color: var(--color-text-muted); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s var(--ap-ease); }
.ap-qjchip:hover { border-color: rgba(0, 136, 234, .4); color: var(--ap-blue); }
.ap-qjchip.is-on { background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 136, 234, .6); }

/* 6th column: custom-bid trigger */
.ap-tbl th.ap-tbl__c, .ap-tbl td.ap-tbl__c { text-align: center; width: 54px; }
.ap-tbl__cbid { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--ap-glass-brd); background: var(--ap-glass); color: var(--ap-blue); cursor: pointer; transition: all .15s var(--ap-ease); }
.ap-tbl__cbid svg { width: 15px; height: 15px; }
.ap-tbl__cbid:hover { background: rgba(0, 136, 234, .12); border-color: rgba(0, 136, 234, .4); }
.ap-tbl tr.is-out .ap-tbl__cbid { opacity: .4; pointer-events: none; }

/* inline custom-bid input row (opens below the clicked team) */
.ap-cbid-row td { padding: 0 !important; background: var(--ap-inset); }
.ap-cbid { display: flex; align-items: center; gap: 10px; padding: 11px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--color-border); }
.ap-cbid__lbl { font-size: 12px; font-weight: 700; color: var(--color-text-muted); }
.ap-cbid__in { flex: 1 1 140px; min-width: 120px; height: 36px; padding: 0 12px; border: 1.5px solid var(--ap-glass-brd); border-radius: 9px; background: var(--color-surface); color: var(--color-text); font-size: 13.5px; font-weight: 700; outline: none; }
.ap-cbid__in:focus { border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(0, 136, 234, .14); }
.ap-cbid__in::-webkit-outer-spin-button, .ap-cbid__in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ap-cbid__ok { height: 36px; padding: 0 18px; border: none; border-radius: 9px; background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.ap-cbid__ok:hover { filter: brightness(1.05); }
.ap-cbid__cancel { height: 36px; padding: 0 14px; border: 1px solid var(--ap-glass-brd); border-radius: 9px; background: var(--ap-glass); color: var(--color-text-muted); font-weight: 700; font-size: 13px; cursor: pointer; }

/* mobile: tournament name must render fully (no ellipsis clipping) */
@media (max-width: 760px) {
  .ap-top__name { white-space: normal; overflow: visible; text-overflow: clip; font-size: 20px; line-height: 1.15; }
  .ap-top__titles { flex-wrap: wrap; }
}

/* custom-bid dropdown — floats anchored to the row's bid button (no table space) */
.ap-cbid-pop { position: fixed; z-index: 60; width: 230px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--ap-glass-brd); border-radius: 12px; background: var(--color-surface); box-shadow: 0 18px 44px -14px rgba(2, 6, 23, .45); animation: ap-pop .16s var(--ap-ease); }
.ap-cbid-pop[hidden] { display: none; }
.ap-cbid-pop__for { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-cbid-pop__for b { color: var(--color-text); font-weight: 800; }
.ap-cbid-pop__in { width: 100%; height: 40px; padding: 0 12px; border: 1.5px solid var(--ap-glass-brd); border-radius: 9px; background: var(--color-surface); color: var(--color-text); font-size: 15px; font-weight: 800; letter-spacing: .3px; outline: none; }
.ap-cbid-pop__in:focus { border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(0, 136, 234, .14); }
.ap-cbid-pop__btns { display: flex; gap: 8px; }
.ap-cbid-pop__ok { flex: 1; height: 38px; border: none; border-radius: 9px; background: linear-gradient(135deg, #1a97f0, var(--ap-blue)); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.ap-cbid-pop__ok:hover { filter: brightness(1.05); }
.ap-cbid-pop__cancel { flex: 1; height: 38px; border: 1px solid var(--ap-glass-brd); border-radius: 9px; background: var(--ap-glass); color: var(--color-text-muted); font-weight: 700; font-size: 13px; cursor: pointer; }
