/* ===================================================================
   Case battle room, second look: the results are a table of rows, one row per case and one column per player, right under the players.
   A bar with every player (and their running total) sits on top of the rows. While the battle runs the table shows the round that is playing and follows it;
   when it is over the whole table opens up. Loads last. Cells use container queries so they fit 2 players or 8 players alike.
   =================================================================== */
.bt-log{--rh:80px;--cg:12px;--sg:8px;margin:18px 0 10px}
.bt-lh{display:flex;align-items:baseline;gap:10px;padding:0 4px 10px}
.bt-lh b{font-size:16px;letter-spacing:-.01em}.bt-lh span{color:var(--muted);font-size:12.5px;font-weight:600}
.bt-lbar,.bt-lrow{display:grid;grid-template-columns:repeat(var(--tn,2),minmax(0,1fr));gap:var(--cg)}
.bt-lbar,.bt-lrow{padding:0 2px}                       /* the same side padding as the arena above, so every column of the table sits right under its player */
.bt-lteam{display:grid;grid-template-columns:repeat(var(--ts,1),minmax(0,1fr));gap:var(--sg);min-width:0;padding:0 9px;border-radius:16px}
.bt-lrow .bt-lteam{background:color-mix(in srgb,var(--tc) 5%,transparent)}

/* the bar: every player and what they have so far */
.bt-lbar{position:sticky;top:64px;z-index:6;padding-top:6px;padding-bottom:8px;background:linear-gradient(180deg,var(--bg) 78%,transparent)}
.bt-bseat{display:flex;align-items:center;gap:9px;min-width:0;padding:9px 12px;border-radius:14px;background:linear-gradient(180deg,color-mix(in srgb,var(--tc) 17%,var(--panel2)),var(--panel2));border:1px solid color-mix(in srgb,var(--tc) 38%,var(--line));transition:border-color .3s,box-shadow .3s,opacity .3s}
.bt-bseat .bt-av{width:30px;height:30px;min-width:30px;flex:none}
.bt-bseat .nm{flex:1;min-width:0;font-weight:700;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-bseat b{font-size:14.5px;font-variant-numeric:tabular-nums;white-space:nowrap}
.bt-bseat.me{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tc) 65%,transparent)}
.bt-lbar .bt-lteam.won .bt-bseat{border-color:var(--accent);box-shadow:0 0 22px color-mix(in srgb,var(--accent) 30%,transparent)}.bt-lbar .bt-lteam.won .bt-bseat b{color:var(--accent)}
.bt-lbar .bt-lteam.lost .bt-bseat{opacity:.62}

/* the rows */
.bt-lrows{position:relative;display:flex;flex-direction:column;gap:8px;padding:2px 0}
.bt-lrows.live{max-height:calc(var(--rh) * 4.4 + 8px * 4);overflow-y:auto;overscroll-behavior:auto;scrollbar-width:thin;padding-right:2px;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 12px,#000 calc(100% - 26px),transparent);mask-image:linear-gradient(180deg,transparent 0,#000 12px,#000 calc(100% - 26px),transparent)}
.bt-lrow{opacity:.62;transition:opacity .35s}
.bt-lrow.cur,.bt-lrow.done{opacity:1}
.bt-cell{--rc:#2b3446;position:relative;container-type:inline-size;height:var(--rh);min-width:0;border-radius:14px;overflow:hidden;display:grid;place-items:center;
  background:linear-gradient(180deg,rgba(255,255,255,.028),transparent),var(--panel);border:1px solid var(--line)}
.bt-cell>i{font-style:normal;font-size:30px;font-weight:900;color:color-mix(in srgb,var(--text) 9%,transparent);letter-spacing:-.02em}
.bt-lrow.cur .bt-cell:not(.full){border-color:color-mix(in srgb,var(--cc) 62%,var(--line));background:linear-gradient(110deg,var(--panel) 30%,color-mix(in srgb,var(--cc) 20%,var(--panel)) 50%,var(--panel) 70%) 0 0/230% 100%;animation:btShim 1.5s linear infinite}
.bt-lrow.cur .bt-cell:not(.full)>i{color:color-mix(in srgb,var(--cc) 60%,transparent)}
@keyframes btShim{from{background-position:130% 0}to{background-position:-130% 0}}
.bt-cell.full{display:block;padding:0;background:linear-gradient(90deg,color-mix(in srgb,var(--rc) 24%,transparent),transparent 78%),linear-gradient(180deg,rgba(255,255,255,.03),transparent),var(--panel);border-color:color-mix(in srgb,var(--rc) 38%,var(--line));box-shadow:inset 0 -3px 0 var(--rc)}
.bt-cell.full .ci{height:100%;display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"im t" "im v";align-items:center;column-gap:8px;padding:6px 12px 6px 6px}
.bt-cell.full .im{grid-area:im;height:100%;display:grid;place-items:center;min-width:0;overflow:hidden}
.bt-cell.full .im img{width:100%;height:100%;max-height:60px;object-fit:contain;filter:drop-shadow(0 5px 9px rgba(0,0,0,.55))}
.bt-cell.full .im .ph{font-size:10px;color:var(--muted);text-align:center}
.bt-cell.full .t{grid-area:t;min-width:0;display:grid;align-self:end}
.bt-cell.full .t em{font-style:normal;font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-cell.full .t b{font-size:13.5px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-cell.full strong{grid-area:v;align-self:start;font-size:14px;font-weight:800;color:var(--rc);font-variant-numeric:tabular-nums;white-space:nowrap}
.bt-cell.top{box-shadow:inset 0 -3px 0 var(--rc),0 0 0 2px var(--accent),0 0 22px color-mix(in srgb,var(--accent) 34%,transparent);z-index:1}
.bt-cell.pop{animation:btPop .9s cubic-bezier(.2,1.3,.3,1)}
@keyframes btPop{0%{transform:scale(.86);opacity:0;box-shadow:0 0 0 0 var(--rc)}35%{transform:scale(1.04);opacity:1;box-shadow:0 0 0 3px var(--rc),0 0 34px var(--rc)}100%{transform:none;box-shadow:inset 0 -3px 0 var(--rc)}}

/* narrow cells (4 to 8 players, phones): the picture, the price, a short name when it fits (the query styles what is INSIDE the cell: a container cannot style itself) */
@container (max-width:132px){
  .bt-cell.full .ci{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:"im" "t" "v";padding:5px 4px;row-gap:1px;text-align:center;justify-items:center}
  .bt-cell.full .t{align-self:center;width:100%}.bt-cell.full .t em{display:none}
  .bt-cell.full .t b{font-size:10px;font-weight:700;line-height:1.12;color:color-mix(in srgb,var(--text) 90%,transparent);white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;text-wrap:balance}   /* the whole skin name, on two lines */
  .bt-cell.full strong{align-self:center;font-size:12.5px}.bt-cell.full .im img{max-height:none}
}
@container (max-width:84px){.bt-cell.full strong{font-size:12px}.bt-cell>i{font-size:22px}}
@container (max-width:70px){   /* too narrow for a name: the picture and the price */
  .bt-cell.full .t{display:none}.bt-cell.full .ci{grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"im" "v"}.bt-cell.full strong{font-size:11.5px}
}
@container (max-width:62px){.bt-cell.full strong{font-size:10.5px;letter-spacing:-.02em}}

/* phones: the bar shows the avatar and the total only, the rows are a little lower, and the sticky bar sits under the (shorter) top bar */
@media (max-width:760px){
  .bt-log{--rh:70px;--cg:8px;--sg:5px}.bt-lbar,.bt-lrow,.bt-lteam{padding-left:0;padding-right:0}.bt-lrow .bt-lteam{background:none}
  .bt-lbar{top:58px}
  .bt-bseat{flex-direction:column;gap:3px;padding:7px 3px;text-align:center;justify-content:center}.bt-bseat .nm{display:none}.bt-bseat b{font-size:12.5px}.bt-bseat .bt-av{width:26px;height:26px;min-width:26px}
  .bt-lrows.live{max-height:calc(var(--rh) * 4.2 + 8px * 4)}
}
@media (max-width:760px){.bt-btns{display:flex;flex-wrap:wrap;gap:8px}.bt-btns .btn{flex:1 1 calc(50% - 8px);justify-content:center}.bt-btns .btn:last-child{flex-basis:100%}}
/* 3 or 4 players on a phone (cells about 80 to 110px wide) and 8 players on a computer get taller rows: the picture, the whole name on two lines, the price */
@media (max-width:760px){.bt-log[style*="--n:3"],.bt-log[style*="--n:4"]{--rh:92px}}
@media (min-width:761px){.bt-log[style*="--n:8"]{--rh:92px}}
@media (max-width:420px){.bt-log[style*="--n:6"],.bt-log[style*="--n:8"]{--sg:3px;--cg:6px;--rh:64px}.bt-log[style*="--n:8"] .bt-bseat b{font-size:10.5px}}
@media (prefers-reduced-motion:reduce){.bt-lrow.cur .bt-cell:not(.full),.bt-cell.pop{animation:none}}

/* ===================================================================
   The reel tiles: the picture, then the weapon, the FULL skin name (it wraps, it is never cut) and the price right under the name.
   The reel is a container (one seat wide), so the tile fits 2 players or 8, on a phone or on a computer; --th is the height of one tile:
   the view is three tiles high and the pointer frames one (tile height is also measured by battles.js at run time, so all of these must agree).
   Wide reels (190px and up): picture left, text right. Narrow (130 to 189px, a phone with 1v1 or 2v2): the same, smaller. Very narrow (under 130px, 3v3 on a phone): picture above the text.
   =================================================================== */
.bt-vreel{container-type:inline-size;container-name:vr;width:100%}

/* the line above each reel (picture, name, total, and "+prize" once the battle is over): it never overflows the seat. Wide seats: one line. Narrower: the total sits under the name. Narrowest: picture and total only */
.bt-seat{container-type:inline-size;container-name:seat}
.bt-arena .bt-seat .bt-sh{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"av nm tot" "pay pay pay";align-items:center;column-gap:8px;row-gap:1px;min-height:38px}
.bt-arena .bt-seat .bt-sh .bt-av{grid-area:av}.bt-arena .bt-seat .bt-sh .bt-nm{grid-area:nm;min-width:0}.bt-arena .bt-seat .bt-sh .bt-tot{grid-area:tot;margin:0;text-align:right;white-space:nowrap}
.bt-arena .bt-seat .bt-sh .bt-pay{grid-area:pay;justify-self:end;margin:0;font-size:12.5px;white-space:nowrap}
@container seat (max-width:215px){
  .bt-arena .bt-seat .bt-sh{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"av nm" "av tot" "pay pay"}
  .bt-arena .bt-seat .bt-sh .bt-tot{text-align:left;font-size:14px}
  .bt-arena .bt-seat .bt-sh .bt-pay{justify-self:start;margin-top:1px}
}
@container seat (max-width:130px){
  .bt-arena .bt-seat .bt-sh{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"av tot" "pay pay";column-gap:5px;min-height:30px}
  .bt-arena .bt-seat .bt-sh .bt-nm{display:none}
  .bt-arena .bt-seat .bt-sh .bt-tot{text-align:right;font-size:12.5px}
  .bt-arena .bt-seat .bt-sh .bt-pay{justify-self:end;font-size:11.5px}
}
.bt-vview,.bt-vptr{--th:92px;--imw:clamp(48px,35cqw,96px)}
.bt-arena .bt-vview{height:calc(var(--th) * 3)}
.bt-arena .bt-vptr{height:var(--th)}
.bt-arena .bt-vtrack .rt-static{height:calc(var(--th) * 3)}
.bt-arena .bt-seat .bt-vtrack .rt{height:var(--th);width:100%;box-sizing:border-box}
.bt-arena .bt-seat .bt-vtrack .rt:not(.star-tile){display:grid;grid-template-columns:var(--imw) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto auto minmax(0,1fr);
  column-gap:clamp(6px,3cqw,10px);row-gap:0;align-items:start;justify-items:stretch;text-align:left;padding:4px clamp(6px,3.4cqw,12px) 4px clamp(5px,3cqw,10px)}
.bt-arena .bt-seat .bt-vtrack .rt-im{grid-column:1;grid-row:1 / -1;align-self:stretch;width:auto;height:auto;min-width:0}
.bt-arena .bt-seat .bt-vtrack .rt-w{grid-column:2;grid-row:2;font-size:clamp(9.5px,5.6cqw,12px);line-height:1.2;color:var(--muted);font-weight:600;white-space:normal;overflow:hidden;text-overflow:clip;overflow-wrap:anywhere;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-width:100%}
.bt-arena .bt-seat .bt-vtrack .rt-n{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;grid-column:2;grid-row:3;flex:none;font-size:clamp(11px,7.2cqw,16px);line-height:1.18;font-weight:800;color:var(--text);
  white-space:normal;overflow:hidden;text-overflow:clip;overflow-wrap:anywhere;text-wrap:balance;max-width:100%;margin-top:1px}
.bt-arena .bt-seat .bt-vtrack .rt-p{grid-column:2;grid-row:4;font-size:clamp(11.5px,7cqw,16px);font-weight:800;line-height:1.2;margin-top:3px;white-space:nowrap;font-variant-numeric:tabular-nums}
@container vr (max-width:149px){
  .bt-vview,.bt-vptr{--th:100px}
}
@container vr (max-width:129px){
  .bt-vview,.bt-vptr{--th:116px;--imw:100%}
  .bt-arena .bt-seat .bt-vtrack .rt:not(.star-tile){grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto auto;row-gap:0;column-gap:0;justify-items:center;text-align:center;padding:4px 3px 5px}
  .bt-arena .bt-seat .bt-vtrack .rt-im{grid-column:1;grid-row:1;width:100%;height:100%;min-height:30px}
  .bt-arena .bt-seat .bt-vtrack .rt-w{grid-column:1;grid-row:2;font-size:9px;display:block;white-space:nowrap;text-overflow:ellipsis;margin-top:2px}
  .bt-arena .bt-seat .bt-vtrack .rt-n{grid-column:1;grid-row:3;font-size:10.5px;line-height:1.15;text-align:center}
  .bt-arena .bt-seat .bt-vtrack .rt-p{grid-column:1;grid-row:4;font-size:12.5px;margin-top:2px}
}

