/* Battle Pass (ui/battlepass.js): everything under #battlepass; the flag at the left edge is #bp-tab (.edge-tab of
   fortune.css). --bpc = one reward field (a finger wide on phones), the rows grow with it */
#ui #battlepass { width: 330px; --bpc: 26px; }
#battlepass .win-body { padding: 4px 5px 5px; }
#battlepass .bp-tic { flex: none; width: 10px; height: 10px; margin-right: 3px; image-rendering: auto; }

/* ---------- top: banner and level ---------- */
#battlepass .bp-top { display: flex; gap: 4px; height: 48px; }
#battlepass .bp-banner { position: relative; flex: none; width: 176px; height: 100%; overflow: hidden;
  background: #0b0a14 url(../assets/ui/battlepass/banner.webp) center / cover no-repeat; image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px #a0824a, inset 0 0 0 2px rgba(0, 0, 0, .55); }
#battlepass .bp-btitle { position: absolute; left: 0; right: 0; top: 3px; text-align: center; font-size: 17px; line-height: 15px; letter-spacing: 1px;
  color: #ffe08a; text-shadow: 1px 0 0 #2a1206, -1px 0 0 #2a1206, 0 1px 0 #2a1206, 0 -1px 0 #2a1206, 1px 1px 0 #2a1206, 0 0 5px rgba(255, 190, 80, .7); pointer-events: none; }
#battlepass .bp-w2 { margin-left: 4px; color: #ff9c52; }
#battlepass .bp-season { position: absolute; left: 6px; right: 6px; top: 18px; text-align: center; font-size: 7px; line-height: 8px; color: #f4ead2;
  text-shadow: var(--ol), 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#battlepass .bp-pbtn { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); min-width: 96px; font-size: 7px; }
#battlepass .bp-pbtn:active { transform: translate(-50%, 1px); }
#battlepass .bp-pbtn.on { color: #a8ec82; cursor: default; }
#battlepass .bp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 4px 5px;
  background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#battlepass .bp-irow { display: flex; align-items: center; gap: 4px; min-width: 0; }
#battlepass .bp-lv { flex: 1; min-width: 0; font-size: 11px; line-height: 12px; color: var(--gold); text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; overflow: hidden; }
#battlepass .bp-clock { flex: none; display: flex; align-items: center; gap: 2px; font-size: 7px; line-height: 8px; color: var(--text); white-space: nowrap; }
#battlepass .bp-clock img { width: 9px; height: 9px; image-rendering: auto; }
#battlepass .bp-up { flex: none; width: 15px; min-width: 0; height: 15px; padding: 0; }
#battlepass .bp-up img { display: block; width: 12px; height: 12px; image-rendering: auto; pointer-events: none; }
#battlepass .bp-up:disabled img { filter: grayscale(1) brightness(.6); }
#battlepass .bp-bar { position: relative; flex: 1; min-width: 0; height: 9px; background: #0c0a08; box-shadow: inset 0 0 0 1px #3a2e22; }
#battlepass .bp-bar > i { position: absolute; left: 1px; top: 1px; bottom: 1px; max-width: calc(100% - 2px); background: linear-gradient(#ffe8a0 0 1px, #f2c45a 1px, #b8862e); }
#battlepass .bp-bart { position: absolute; inset: 0; text-align: center; font-size: 7px; line-height: 9px; color: #fff; text-shadow: var(--ol); white-space: nowrap; }
#battlepass .bp-msg { padding: 14px 6px; font-size: 8px; line-height: 10px; text-align: center; color: var(--dim); }

/* ---------- the pages: the same height for both tabs (the window does not jump) ---------- */
#battlepass .bp-page { position: relative; height: 118px; margin-top: 4px; display: flex; flex-direction: column; }
/* rewards: row heads on the left, one column per level in a strip that scrolls sideways. Both have the same rows:
   the numbers (--bpn), the free row and the premium row (--bph, a line between them) - heads and fields line up */
#battlepass { --bpn: 14px; --bph: calc(var(--bpc) + 14px); }
#battlepass .bp-track { display: flex; padding: 1px; background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#battlepass .bp-heads { flex: none; width: 40px; display: flex; flex-direction: column; box-shadow: 1px 0 0 #47423a; }
#battlepass .bp-corner { flex: none; height: var(--bpn); font-size: 6px; line-height: var(--bpn); text-align: center; color: var(--dim); text-shadow: var(--ol); white-space: nowrap; overflow: hidden; }
#battlepass .bp-head { flex: none; height: var(--bph); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 7px; line-height: 7px; color: #d8cfbd; text-shadow: var(--ol); background: linear-gradient(90deg, #221d18, #14110f); }
#battlepass .bp-head img { display: block; width: 24px; height: 24px; image-rendering: auto; }
#battlepass .bp-head.p { flex: 1 0 auto; color: var(--gold); background: linear-gradient(90deg, #35280f, #191208); }
#battlepass :is(.bp-head, .bp-slot).p { box-shadow: inset 0 1px 0 #3a3229; }
#battlepass .bp-strip { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
#battlepass .bp-cols { display: flex; width: max-content; }
#battlepass .bp-col { flex: none; width: calc(var(--bpc) + 6px); display: flex; flex-direction: column; }
#battlepass .bp-col + .bp-col { box-shadow: inset 1px 0 0 #2c261f; }
#battlepass .bp-col.cur { background: linear-gradient(rgba(242, 196, 90, .14), rgba(242, 196, 90, .03)); }
#battlepass .bp-slot { flex: none; height: var(--bph); display: flex; align-items: center; justify-content: center; }
/* the number of the level in a diamond (both in one grid cell: exactly centred); past ones bronze, the own level gold */
#battlepass .bp-num { flex: none; height: var(--bpn); display: grid; place-items: center; }
#battlepass .bp-num > * { grid-area: 1 / 1; }
#battlepass .bp-num i { width: 9px; height: 9px; transform: rotate(45deg); background: #2a2520; box-shadow: inset 0 0 0 1px #6d6252; }
/* Jersey's digits carry one font pixel (~.5 px with the font-size-adjust of #ui) of space on their right and sit low in
   the line: padding and translate put the ink, not the box, in the middle (measured on screen pixels at UI size 2: every digit
   was 1 px right and 1 px low with the old 1.5 px padding) */
#battlepass .bp-num span { position: relative; translate: 0 -.5px; padding-left: .5px; font-size: 7px; line-height: 7px; height: 7px; color: #d8cfbd; text-shadow: var(--ol); }
#battlepass .bp-col.past .bp-num i { background: #3a3020; box-shadow: inset 0 0 0 1px #9a8150; }
#battlepass .bp-col.cur .bp-num i { background: #9a6c1e; box-shadow: inset 0 0 0 1px #ffd86a, 0 0 3px #f2c45a; }
#battlepass .bp-col.cur .bp-num span { color: #fff6d0; }
/* a reward field: green = ready (pulses, click takes it), a check = taken, a lock = premium without the pass */
#battlepass .bp-cell { position: relative; flex: none; width: var(--bpc); height: var(--bpc);
  background: linear-gradient(#1f1b17, #100d0b); box-shadow: inset 0 0 0 1px #4c443a, inset 0 2px 0 #060504; }
#battlepass .bp-cell.p { background: linear-gradient(#2a2013, #120d08); box-shadow: inset 0 0 0 1px #6f5a32, inset 0 2px 0 #060504; }
#battlepass .bp-cell.none { background: none; box-shadow: none; }
#battlepass .bp-cell img.ic { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; object-fit: contain; pointer-events: none; }
#battlepass .bp-cell .cnt { position: absolute; right: 2px; bottom: 2px; z-index: 2; font-size: 6px; line-height: 6px; color: #fff; text-shadow: var(--ol); pointer-events: none; }
#battlepass .bp-cell .bp-more { position: absolute; left: 2px; top: 1px; z-index: 2; font-size: 8px; line-height: 7px; color: var(--gold); text-shadow: var(--ol); pointer-events: none; }
#battlepass .bp-cell.wait img.ic { filter: brightness(.8); }
#battlepass .bp-cell.lock img.ic { filter: grayscale(.7) brightness(.55); }
#battlepass .bp-cell .bp-lock { position: absolute; left: 1px; bottom: 1px; z-index: 3; width: 9px; height: 9px; image-rendering: auto; pointer-events: none; filter: drop-shadow(0 0 1px #000); }
#battlepass .bp-cell.lock { cursor: pointer; }
#battlepass .bp-cell.got img.ic { opacity: .3; }
#battlepass .bp-cell .bp-check { position: absolute; left: 50%; top: 50%; z-index: 3; width: 14px; height: 14px; margin: -7px 0 0 -7px; image-rendering: auto; pointer-events: none; }
#battlepass .bp-cell.ready { cursor: pointer; background: radial-gradient(circle, #4a7a30, #1d3414);
  box-shadow: inset 0 0 0 1px #4c8a32, 0 0 1px 0 rgba(120, 214, 90, .2); }
#battlepass .bp-cell.ready::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px #9ae66a, 0 0 3px 1px rgba(120, 214, 90, .5); animation: glow-in 1.2s ease-in-out infinite; }
#battlepass .bp-cell.ready:hover { filter: brightness(1.2); }
#battlepass .bp-foot { display: flex; justify-content: flex-end; margin-top: auto; }
/* what came with the last click: over the strip, a click or a few seconds and it is gone */
#battlepass .bp-got { position: absolute; left: 42px; right: 2px; top: 2px; z-index: 5; max-height: 92px; overflow-y: auto; padding: 3px 5px; cursor: pointer;
  background: rgba(14, 11, 8, .96); box-shadow: inset 0 0 0 1px var(--gold-d), 0 2px 4px rgba(0, 0, 0, .6); }
#battlepass .bp-gt { margin-bottom: 2px; font-size: 8px; line-height: 9px; color: var(--gold); }
#battlepass .bp-gl { display: flex; flex-wrap: wrap; gap: 2px 7px; }
#battlepass .bp-gr { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: 7px; line-height: 9px; }
#battlepass .bp-gr img { flex: none; width: 10px; height: 10px; object-fit: contain; }

/* ---------- missions: of the day left, of the week right ---------- */
#battlepass .bp-mis { overflow-y: auto; overflow-x: hidden; }
#battlepass .bp-mcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
#battlepass .bp-mcol { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#battlepass .bp-mhead { display: flex; align-items: center; justify-content: space-between; gap: 4px; height: 10px; border-bottom: 1px solid #3a3229; }
#battlepass .bp-mt { flex: none; font-size: 8px; line-height: 9px; color: var(--gold); }
#battlepass .bp-reset { min-width: 0; font-size: 7px; line-height: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* every row the same height: the task in at most two lines (the whole of it in the tooltip), the bar under it */
#battlepass .bp-m { flex: none; display: flex; align-items: center; gap: 3px; height: 25px; padding: 0 3px; background: linear-gradient(90deg, #1d1914, #131010); box-shadow: inset 0 0 0 1px #3c362e; }
#battlepass .bp-m.ok { background: linear-gradient(90deg, #1c2c15, #121810); box-shadow: inset 0 0 0 1px #4f7d34; }
#battlepass .bp-mic { flex: none; width: 16px; height: 16px; object-fit: contain; image-rendering: auto; }
#battlepass .bp-mb { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
#battlepass .bp-mtx { max-height: 14px; font-size: 7px; line-height: 7px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#battlepass .bp-m.ok .bp-mtx { color: var(--dim); }
#battlepass .bp-mbar { flex: none; position: relative; height: 7px; background: #0c0a08; box-shadow: inset 0 0 0 1px #3a2e22; }
#battlepass .bp-mbar > i { position: absolute; left: 1px; top: 1px; bottom: 1px; max-width: calc(100% - 2px); background: linear-gradient(#c6ec9e 0 1px, #78d65a 1px, #3f8a2a); }
#battlepass .bp-mbar > span { position: absolute; inset: 0; text-align: center; font-size: 6px; line-height: 7px; color: #fff; text-shadow: var(--ol); white-space: nowrap; }
#battlepass .bp-mx { flex: none; width: 24px; display: flex; flex-direction: column; align-items: center; font-size: 5px; line-height: 6px; color: var(--dim); text-align: center; white-space: nowrap; }
#battlepass .bp-mx b { font-weight: normal; font-size: 8px; line-height: 8px; color: var(--gold); text-shadow: var(--ol); }
#battlepass .bp-roll { position: relative; flex: none; width: 15px; min-width: 0; height: 15px; padding: 0; }
#battlepass .bp-roll img { display: block; width: 11px; height: 11px; image-rendering: auto; pointer-events: none; }
#battlepass .bp-roll:disabled img { filter: grayscale(1) brightness(.6); }
#battlepass .bp-roll .cnt { position: absolute; right: 0; bottom: 0; font-size: 5px; line-height: 5px; color: #fff; text-shadow: var(--ol); pointer-events: none; }
#battlepass .bp-mok { flex: none; width: 15px; height: 15px; image-rendering: auto; }
#battlepass .bp-empty { padding: 6px 2px; font-size: 7px; line-height: 8px; text-align: center; }

/* ---------- the tabs under the pages ---------- */
#battlepass .bp-tabs { margin: 4px 0 0; }
#battlepass .bp-tab { display: flex; align-items: center; justify-content: center; gap: 3px; height: 14px; line-height: 14px; }
#battlepass .bp-tab img { width: 11px; height: 11px; image-rendering: auto; pointer-events: none; }

/* ---------- phones (ui/touch.js): a finger per field and button, the window scrolls when the screen is low ---------- */
html.touch #ui #battlepass { width: min(330px, calc((100% - 8px) / var(--wz))); --bpc: max(26px, var(--finger)); }
/* banner: title, season and the finger-high button one under the other (2-15, 15-23, 24-46); the rows below give the
   height back (smaller heads, tighter gaps), so the whole window fits a 360 px phone without scrolling */
html.touch #ui #battlepass .win-body { padding: 3px 5px 3px; }
html.touch #ui #battlepass .bp-top { height: 48px; }
html.touch #ui #battlepass .bp-banner { width: 150px; }
html.touch #ui #battlepass .bp-btitle { top: 2px; font-size: 14px; line-height: 13px; }
html.touch #ui #battlepass .bp-season { top: 15px; }
html.touch #ui #battlepass .bp-pbtn { bottom: 2px; }
/* both tabs as high as the rewards (numbers, two rows, frame + scrollbar 4 px, the button): the missions scroll inside */
html.touch #ui #battlepass .bp-page { height: calc(var(--bpn) + 2 * var(--bph) + 4px + var(--finger)); margin-top: 2px; }
html.touch #ui #battlepass .bp-mis { max-height: none; }
html.touch #ui #battlepass { --bph: calc(var(--bpc) + 6px); }
html.touch #ui #battlepass .bp-head img { width: 22px; height: 22px; }
html.touch #ui #battlepass .bp-tabs { margin-top: 2px; }
html.touch #ui #battlepass .bp-up, html.touch #ui #battlepass .bp-roll { width: var(--finger); height: var(--finger); }
html.touch #ui #battlepass .bp-up img, html.touch #ui #battlepass .bp-roll img { width: 16px; height: 16px; }
html.touch #ui #battlepass .bp-m { height: auto; min-height: calc(var(--finger) + 4px); padding: 2px 3px; }
html.touch #ui #battlepass .bp-mcols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
