/* ITZA Chess - bots.css
   Styling for the Challengers picker + avatars. Uses the app's own design
   tokens (--elev/--panel/--line/--ink/--gold/--green/--rad) so it blends in
   both dark and light themes. --card is used-but-undefined in app.css, so we
   fall back to --elev. The Strength|Challengers tabs reuse .modebtn from
   app.css; the Play button reuses .btn.gold. */

/* ----- Strength | Challengers tabs (panes toggled by .on) ----- */
#oppTabs { margin-top: 16px; }   /* air between the Clock select and the tabs */
.cbPane { display: none; }
.cbPane.on { display: block; }

/* ----- challenger list ----- */
.cbList {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 46vh; overflow-y: auto; margin: 4px 0 2px;
  padding-right: 3px;
}
.cbRow {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 8px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card, var(--elev));
  transition: border-color .12s, background .12s;
}
.cbRow:hover { border-color: var(--ink3); }
.cbRow.sel { border-color: var(--accent); background: rgba(30, 62, 98, .10); }
.cbRowMain { flex: 1 1 auto; min-width: 0; }
.cbName { font-weight: 700; font-size: 15px; line-height: 1.2; }
.cbTag {
  font-size: 12px; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cbStyle {
  flex: 0 0 auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink3); padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px;
}
.cbElo {
  flex: 0 0 auto; font-weight: 800; font-size: 12.5px; color: var(--accent);
  padding: 2px 8px; border: 1px solid var(--ctrl-line); border-radius: 999px;
  background: var(--ctrl);
}
.cbNear {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--green); padding: 2px 7px; border-radius: 999px;
}

/* ----- rated-range lock (Normal mode only; mirrors the contract's check) ----- */
.cbRow.lock { opacity: .55; }
.cbRow.lock:hover { border-color: var(--line); }      /* no invite glow */
.cbRow.lock .cbAv img { filter: grayscale(.7); }
.cbLock {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700;
  color: var(--ink2); background: var(--elev);
  border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px;
}
.cbLockWhy {
  text-align: left; font-size: 13px; line-height: 1.5; color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 9px 11px; margin: 4px 2px 12px;
  background: var(--card, var(--elev));
}

/* shared bits used by the bot window */
.cbPersona{color:var(--ink); font-size:13.5px; line-height:1.5; margin:6px 0 10px}
.cbPlay{margin:0}

/* ----- bot window (opens on tapping a challenger) ----- */
.cbSheet{
  position:fixed; inset:0; z-index:10000;
  display:flex; align-items:center; justify-content:center; padding:18px;
  background:rgba(0,0,0,.6); animation:cbFade .12s ease;
}
.cbSheetCard{
  position:relative; width:min(94vw,460px); max-height:88vh; overflow-y:auto;
  background:var(--panel); border:1px solid var(--line); border-radius:16px;
  padding:16px; box-shadow:0 24px 70px rgba(0,0,0,.5); text-align:center;
}
.cbSheetImg{
  width:100%; max-height:44vh; object-fit:cover; object-position:center top;
  border-radius:12px; border:none; display:block;   /* no border - a light line under a dark photo reads as an artifact */
}
.cbSheetName{font-weight:800; font-size:20px; margin-top:10px}
.cbSheetTag{color:var(--ink2); font-size:13px; margin-top:2px}
.cbSheetMeta{display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin-top:8px}
.cbSheetCard .cbPersona{text-align:left; margin:10px 2px 14px}
.cbSheetBtns{display:flex; gap:8px; justify-content:center; flex-wrap:wrap}
.cbSheetBtns .cbPlay{margin:0}
.cbSheetX{
  position:absolute; top:8px; right:8px; width:34px; height:34px; border-radius:50%;
  border:none; cursor:pointer; font-size:22px; line-height:1;
  background:rgba(0,0,0,.45); color:#fff;
}
.cbSheetX:hover{background:rgba(0,0,0,.65)}

/* ----- avatar tile (rounded SQUARE: picker rows, game header, profile) -----
   The tile must never be squashed into a lozenge by a tight flex row - that is
   what made the player-bar avatar look wrong on phones. Fixed aspect + no
   shrink + a small fixed radius keeps it square everywhere. */
.cbAv{
  display:inline-block; overflow:hidden; border-radius:18%;
  border:1px solid var(--line); background:var(--elev);
  flex:0 0 auto; vertical-align:middle; position:relative;
}
.cbAv img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block}
.cbAv.clk{cursor:pointer}
.cbAv.clk:hover{border-color:var(--accent)}

/* game-screen player bars: avatar keeps its square, the NAME truncates instead */
.playerbar .pavatar{display:inline-flex; margin-right:2px; flex:0 0 auto}
.playerbar .pname{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

/* ----- settings: profile block + tab panes ----- */
.setPane{display:none}
.setPane.on{display:block}
.profTop{display:flex; align-items:center; gap:12px; margin-bottom:10px}
.profTopMain{flex:1 1 auto; min-width:0}
.profAv{border-radius:10px}
.avBtns{display:flex; gap:6px; margin-top:6px; flex-wrap:wrap}

/* ----- full-image lightbox ----- */
.cbLightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; background: rgba(0, 0, 0, .82);
  animation: cbFade .12s ease;
}
@keyframes cbFade { from { opacity: 0; } to { opacity: 1; } }
.cbLightbox img {
  display: block;   /* inline images leave a baseline gap below */
  max-width: min(92vw, 560px); max-height: 82vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.cbLightbox .cbCap { color: #fff; font-weight: 700; font-size: 15px; }
.cbLightbox .cbX {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; border: none;
  font-size: 24px; line-height: 1;
}
.cbLightbox .cbX:hover { background: rgba(255, 255, 255, .26); }

@media (prefers-reduced-motion: reduce) {
  .cbRow { transition: none; }
  .cbLightbox { animation: none; }
}
