.ar { container-type: inline-size; display: flex; flex-direction: column; gap: 14px; width: 100%; color: var(--c-text); font-family: inherit; }
.ar > * { flex-shrink: 0; }
.ar-card { border-radius: 16px; background: var(--c-card); border: 1px solid rgba(181, 201, 255, 0.06); }
.ar-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@container (min-width: 900px) {
  .ar-main { grid-template-columns: minmax(0, 1fr) 400px; }
  .ar-bets { max-height: calc(100dvh - 120px); }
}
.ar-coin { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; background: var(--coin-icon) no-repeat center / contain; }

.ar-arena { padding: 14px; min-width: 0; }
.ar-top { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ar-stat { min-width: 96px; padding: 10px 14px; border-radius: 13px; background: var(--c-card-2); }
.ar-stat span { display: block; color: var(--c-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.ar-stat b { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-stat b em { font-style: normal; }
.ar-stat b.g { color: var(--c-green-text); }
.ar-timer { flex: 1; min-width: 180px; }
.ar-tbar { height: 6px; margin-top: 7px; border-radius: 99px; background: var(--c-hover); overflow: hidden; }
.ar-tbar i { display: block; width: 100%; height: 100%; border-radius: 99px; background: var(--c-green); transition: width 0.25s linear; }

.ar-box { position: relative; }
.ar-box canvas { display: block; width: 100%; max-width: 100%; height: auto; }
.ar-status { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 6px 16px; border: 1px solid var(--c-line); border-radius: 999px; background: rgba(3, 8, 22, 0.82); backdrop-filter: blur(6px); color: var(--c-muted); font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.ar-status b { color: #fff; }
.ar-winner { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; padding: 0 10px; pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s; }
.ar-winner.on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s, visibility 0s; }
.ar-winner.on .ar-wcard { animation: ar-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.ar-wcard { display: flex; align-items: center; gap: 14px; max-width: 100%; padding: 10px 18px 10px 10px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px; background: rgba(22, 27, 41, 0.94); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.ar-wcard .ar-av { width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }
.ar-wtext { min-width: 0; }
.ar-wtext small { display: block; color: var(--c-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ar-wtext b { display: block; font-size: 17px; font-weight: 800; }
.ar-won { display: flex; align-items: center; gap: 6px; color: var(--c-green-text); font-size: 18px; font-weight: 800; white-space: nowrap; }
@keyframes ar-pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ar-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.ar-mine { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 22px; padding: 10px 14px; border-radius: 13px; background: var(--c-card-2); }
.ar-mine span { display: block; color: var(--c-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ar-mine b { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ar-mine b em { font-style: normal; }
.ar-join { height: 46px; padding: 0 30px; border: 0; border-radius: 15px; background: var(--c-green); color: var(--c-on-green); font: inherit; font-size: 14px; font-weight: 900; letter-spacing: 0.02em; white-space: nowrap; cursor: pointer; }
.ar-join { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ar-join-label { position: relative; z-index: 1; }
.ar-join .ba { --ba-r: 15px; }
.ar-arena:hover .ar-join:not(:disabled) { --ba-on: 1; --ba-play: running; }
.ar-join:hover { background: var(--c-green-hover); }
.ar-join:disabled { background: var(--c-green-disabled); cursor: not-allowed; }

.ar-av { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; box-sizing: border-box; background: #1e2332; overflow: hidden; }
.ar-av-link { cursor: pointer; }
.ar-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1e2332; }

.ar-bets { display: flex; flex-direction: column; min-width: 0; padding: 14px 10px 10px; overflow: hidden; }
.ar-bets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 6px 10px; }
.ar-bets-head b { font-size: 16px; font-weight: 800; }
.ar-bets-list { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.ar-bets-list::-webkit-scrollbar { display: none; }
.ar-bet { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-radius: 12px; background: rgba(29, 35, 51, 0.55); transition: opacity 0.4s, background 0.4s, box-shadow 0.4s; }
.ar-bet { content-visibility: auto; contain-intrinsic-size: auto 33px; }   /* rows out of view: no layout / paint (33px: a row without its padding) */
.ar-bet::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--c); }
.ar-bet.me { background: linear-gradient(90deg, rgba(50, 193, 107, 0.12), rgba(29, 35, 51, 0.55) 60%); }
.ar-bet.win { background: linear-gradient(90deg, rgba(50, 193, 107, 0.2), rgba(29, 35, 51, 0.7) 70%); box-shadow: inset 0 0 0 2px rgba(50, 193, 107, 0.6); }
.ar-bet.dim { opacity: 0.45; }
.ar-who { min-width: 0; }
.ar-who b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-who b em { color: var(--c-muted); font-style: normal; font-weight: 700; }
.ar-who small { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--c-green-text); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ar-val { font-style: normal; }
.ar-who .pf-coin { width: 13px; height: 13px; }
.ar-pc { min-width: 46px; padding: 4px 6px; border-radius: 8px; background: color-mix(in srgb, var(--c) 18%, transparent); color: #fff; font-size: 13px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.ar-none { animation: ar-fade 0.35s ease-out; padding: 24px 10px; color: var(--c-muted); font-size: 13px; font-weight: 700; text-align: center; }

.pf-coin { width: 16px; height: 16px; flex-shrink: 0; }
.pf-items { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; border-radius: 10px; }
.pf-items.has { width: fit-content; max-width: 100%; margin: -5px; padding: 5px; box-sizing: content-box; cursor: pointer; transition: background 0.15s; }
.pf-items.has:hover { background: var(--c-hover); }
.pf-items.has:hover .pf-more { color: #6ee39a; }
.pf-it { position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: var(--c-card-2) radial-gradient(60% 30% at 50% 100%, color-mix(in srgb, var(--r) 35%, transparent), transparent); overflow: hidden; }
.pf-it::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 0; height: 2px; border-radius: 2px; background: var(--r); }
.pf-it img { width: 100%; height: 100%; padding: 4px; box-sizing: border-box; object-fit: contain; }
.ar-items-cell { display: flex; width: 134px; }
.pf-more { min-width: 22px; color: var(--c-muted); font-size: 12px; font-weight: 800; white-space: nowrap; }

.ar-hist { padding: 14px; min-width: 0; }
.ar-hist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ar-hist-head b { font-size: 16px; font-weight: 800; }
.ar-hist-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 140px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 140px), transparent); }
.ar-hist-row::-webkit-scrollbar { display: none; }
.ar-hist-row .ar-none { width: 100%; padding: 10px; }
.ar-hi { display: flex; align-items: center; gap: 10px; flex: none; padding: 9px 14px 9px 10px; border-radius: 12px; background: var(--c-card-2); }
.ar-hi .ar-av { font-size: 11px; }
.ar-hi-who b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; }
.ar-hi-who small { display: block; margin-top: 2px; color: var(--c-muted); font-size: 11px; font-weight: 700; }
.ar-hi-won { display: flex; align-items: center; gap: 5px; margin-left: 8px; color: var(--c-green-text); font-size: 14px; font-weight: 800; white-space: nowrap; }

.ar-pick-title { position: absolute; width: 94%; color: var(--lb-text-main); text-align: center; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.01em; }
.ar-pick-x { margin-left: auto; z-index: 2; cursor: pointer; }
.ar-pick-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--c-muted); font-size: 14px; font-weight: 700; }
.ar-pick-empty[hidden] { display: none; }
.ar-pick-lbl { color: #b5c9ff80; font-size: 12px; font-weight: 500; line-height: 14px; text-align: right; }
.items_total .ar-seltot { padding-bottom: 0; font-size: 15px; text-align: center; --coin: 14px; --coin-dy: 0.9px; }

.pfm { position: fixed; inset: 0; z-index: 1005; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--c-overlay); backdrop-filter: blur(4px); }
.pfm-box { display: flex; flex-direction: column; gap: 14px; width: min(400px, 100%); max-height: min(560px, calc(100dvh - 24px)); padding: 20px; box-sizing: border-box; border: 2px solid var(--c-line); border-radius: 15px; background: var(--c-card); }
.pfm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pfm-head b { display: block; color: var(--c-text); font-size: 1.05rem; font-weight: 800; }
.pfm-head small { display: block; margin-top: 3px; color: var(--c-muted); font-size: 12px; font-weight: 700; }
.pfm-x { display: flex; padding: 0; border: 0; background: none; color: #b5c9ff; opacity: 0.8; cursor: pointer; }
.pfm-x:hover { opacity: 1; }
.pfm-x svg { width: 24px; height: 24px; }
.pfm-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; scrollbar-width: none; }
.pfm-list::-webkit-scrollbar { display: none; }
.pfm-row { display: flex; align-items: center; gap: 12px; height: 60px; flex-shrink: 0; padding: 0 14px 0 6px; border-radius: 15px; background: linear-gradient(90deg, color-mix(in srgb, var(--r) 30%, transparent) 0, transparent 70%), var(--c-card-2); }
.pfm-tile { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex-shrink: 0; box-sizing: border-box; border: 2px solid var(--c-line); border-radius: 10px; background: #0c1120; }
.pfm-tile img { width: 34px; height: 34px; object-fit: contain; }
.pfm-info { flex: 1; min-width: 0; }
.pfm-info b { display: block; color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfm-info span { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--c-green-text); font-size: 12px; font-weight: 800; }
.pfm-info .pf-coin { width: 13px; height: 13px; }
.pfm-qty { padding: 4px 9px; border-radius: 8px; background: #252c40; color: #c7d0e8; font-size: 13px; font-weight: 800; }
.pfm-total { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 13px; background: var(--c-card-2); color: var(--c-muted); font-size: 13px; font-weight: 800; }
.pfm-total b { display: inline-flex; align-items: center; gap: 6px; color: var(--c-text); font-size: 15px; }

@container (max-width: 560px) {
  .ar-arena { padding: 10px; }
  .ar-top { gap: 6px; }
  .ar-stat { flex: 1; min-width: 0; padding: 8px 10px; }
  .ar-stat b { font-size: 15px; }
  .ar-timer { flex-basis: 100%; margin-left: 0; }
  .ar-mine { flex-basis: 100%; min-width: 0; }
  .ar-join { flex: 1; padding: 0 12px; }
  .ar-wcard { gap: 10px; padding: 8px 12px 8px 8px; }
  .ar-wcard .ar-av { width: 38px; height: 38px; font-size: 13px; }
  .ar-wtext b { font-size: 14px; }
  .ar-wtext small { font-size: 9px; }
  .ar-won { font-size: 15px; }
  .ar-bet { gap: 8px; padding: 8px 8px 8px 10px; }
  .ar-bet { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
  .pf-it { width: 30px; height: 30px; border-radius: 8px; }
  .ar-items-cell { width: 126px; }
  .ar-pc { min-width: 0; padding: 3px 6px; font-size: 12px; }
}

@keyframes ar-fade { from { opacity: 0; } }
@media (hover: hover) and (pointer: fine) {
  .ar-hist-row { cursor: grab; }
  .ar-hist-row.ar-dragging, html.ar-grabbing, html.ar-grabbing * { cursor: grabbing !important; }
  .ar-hist-row.ar-dragging { user-select: none; -webkit-user-select: none; }
}
/* phone: the item window is full screen with CLOSE at the bottom, no title bar */
@media (max-width: 480px) { .ar-pick .items-modal__header { display: none; } }

/* phone / tablet: the blocks 1px inside the bottom menu on each side, like on the other pages */
@media (max-width: 1080px) { body.arena-page-body .main { width: auto; padding-left: 9px; padding-right: 9px; } }