/* ── AUTO REJOIN PAGE ── */
#page-auto-rejoin {
  padding: 0 16px 24px;
}

/* Bảng số lần: Rejoin / Kick / Mất kết nối */
.rj-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.rj-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(0,180,255,.03);
  border: 1px solid rgba(0,180,255,.14);
  border-radius: 8px;
  min-width: 0;
}
.rj-stat b {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rj-stat small {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Nút Reset: hàng riêng, dài hết chiều ngang dưới 3 ô số */
.rj-stats-reset {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 8px;
}

/* Thông báo (chỉ hiện khi có lỗi / kết quả) */
.rj-msg {
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
  padding: 0 4px;
}
.rj-msg.ok  { color: #4ade80; }
.rj-msg.err { color: #f43f5e; }

/* Nút nhỏ (bảng account, reset) */
.rj-btn {
  padding: 4px 10px;
  background: rgba(0,180,255,.05);
  border: 1px solid rgba(0,180,255,.2);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.rj-btn:hover { background: rgba(0,180,255,.14); border-color: rgba(0,210,255,.45); color: #fff; }
.rj-btn:disabled { opacity: .5; cursor: default; }
.rj-btn.on { border-color: rgba(0,220,255,.55); background: rgba(0,180,255,.16); }
.rj-btn--x { color: #f87171; border-color: rgba(244,63,94,.3); background: rgba(244,63,94,.05); }
.rj-btn--x:hover { color: #fff; background: rgba(244,63,94,.18); border-color: rgba(244,63,94,.6); }

/* Kill Roblox: lúc thường giống HỆT các nút khác; chỉ khi bấm mới sáng lên (.active) rồi tắt */
.perf-action-btn.rj-kill.active, .perf-action-btn.rj-kill.active:hover { background: rgba(0,180,255,.22); border-color: rgba(0,220,255,.7); color: #fff; box-shadow: 0 0 16px rgba(0,180,255,.3); }
.perf-action-btn.rj-kill.active svg { color: #fff; opacity: 1; }

/* Ô nhập text dài trong perf-adv (link VIP, exe) */
#page-auto-rejoin .perf-adv-input { text-align: left; }
#page-auto-rejoin .perf-adv-group { min-width: 140px; }

/* Thêm account */
.rj-add {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.rj-ck {
  flex: 1;
  min-width: 0;
  resize: vertical;
  min-height: 64px;
  background: rgba(0,180,255,.05);
  border: 1px solid rgba(0,180,255,.2);
  border-radius: 8px;
  color: var(--text);
  font: 12px/1.5 ui-monospace, Consolas, monospace;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s;
}
.rj-ck:focus { border-color: rgba(0,210,255,.5); }
.rj-ck::placeholder { color: var(--text-muted); }
.rj-add .perf-preset-btn { flex: 0 0 140px; }
@media (max-width: 600px) {
  .rj-add { flex-direction: column; }
  .rj-add .perf-preset-btn { flex-basis: auto; }
}

/* Bảng account */
.rj-tw td { vertical-align: middle; }
.rj-st { display: inline-flex; align-items: center; gap: 6px; }
.rj-st i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c, #8a919c); box-shadow: 0 0 6px var(--c, #8a919c); }
.rj-st span { color: var(--c, #8a919c); }
.rj-last small { display: block; color: var(--text-muted); font-size: 11px; max-width: 360px; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.rj-acts { display: flex; gap: 6px; justify-content: flex-end; }
.rj-off td:first-child { opacity: .55; }
.rj-empty { text-align: center; color: var(--text-muted) !important; padding: 16px !important; }

/* Log */
.rj-log {
  height: 180px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(0,180,255,.12);
  border-radius: 8px;
  color: #9aa3bc;
  font: 12px/1.6 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Kiểm tra script crash */
.rj-code { width: 100%; min-height: 110px; }
.rj-ds-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rj-ds-list:empty { display: none; }
.rj-ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  background: rgba(0,180,255,.06);
  border: 1px solid rgba(0,180,255,.25);
  border-radius: 999px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.rj-ds-chip small { color: var(--text-muted); font-weight: 600; font-size: 11px; }
.rj-ds-chip .rj-btn { padding: 2px 8px; border-radius: 999px; }

/* ── UI nổi (modal) ── */
.rj-modal {
  position: fixed;
  inset: 0;
  z-index: 200;   /* trên viền neon (100) */
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
}
.rj-modal[hidden] { display: none; }
.rj-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,5,9,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: rj-fade .15s ease-out;
}
.rj-modal__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  margin: 0;
  background: #0a0d14;
  box-shadow: 0 0 0 1px rgba(0,180,255,.12), 0 0 32px rgba(0,180,255,.18), 0 24px 60px rgba(0,0,0,.6);
  animation: rj-pop .18s cubic-bezier(.22,1,.36,1);
}
.rj-modal__hd { position: relative; }
.rj-modal__x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.rj-modal .perf-btn-row .perf-preset-btn { padding: 11px 10px; }
@keyframes rj-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rj-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rj-modal__backdrop, .rj-modal__panel { animation: none; }
}

/* ── Script trong Autoexec ── */
.rj-ax { display: flex; flex-direction: column; gap: 8px; }
.rj-ax-hd { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rj-ax-hd .perf-adv-label { text-align: center; }
.rj-ax-list {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,180,255,.14);
  border-radius: 8px;
  overflow: hidden;
}
.rj-ax-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text);
  font: 600 13px/1.4 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.rj-ax-row:last-child { border-bottom: 0; }
.rj-ax-row:hover, .rj-ax-row:focus-visible { background: rgba(0,180,255,.08); outline: none; }
.rj-ax-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rj-ax-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj-ax-meta-s { color: var(--text-muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rj-ax-row .rj-ax-chev { color: var(--text-muted); }
.rj-ax-empty { padding: 14px 12px; text-align: center; color: var(--text-muted); font-size: 12px; }
.rj-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font: 700 10px/1.6 'Rajdhani', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.rj-tag--mon  { color: #4ade80; background: rgba(74,222,128,.08); }
.rj-tag--hb   { color: rgb(0,210,255); background: rgba(0,210,255,.08); }
.rj-tag--miss { color: #fbbf24; background: rgba(251,191,36,.08); }
@media (max-width: 600px) {
  .rj-ax-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rj-ax-row .rj-ax-meta-s { display: none; }
}

/* Modal xem code */
.rj-modal__panel--wide { width: min(860px, 100%); }
.rj-ax-title { text-transform: none; letter-spacing: .06em; font-size: 20px; max-width: calc(100% - 80px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj-ax-meta { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }
.rj-code-view {
  margin: 0;
  max-height: min(55vh, 520px);
  min-height: 120px;
  overflow: auto;
  padding: 10px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(0,180,255,.14);
  border-radius: 8px;
  color: #c9d1e6;
  font: 12px/1.6 ui-monospace, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.rj-code-view:focus-visible { outline: 1px solid rgba(0,210,255,.5); }
.rj-danger { color: #f87171; border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.05); }
.rj-danger:hover { color: #fff; background: rgba(244,63,94,.18); border-color: rgba(244,63,94,.65); }
.rj-danger.is-confirm { color: #fff; background: rgba(244,63,94,.35); border-color: #f43f5e; box-shadow: 0 0 14px rgba(244,63,94,.35); }

/* Ô dán code: 1 dòng, cao bằng ô Tên script (vẫn là textarea để giữ xuống dòng khi dán script nhiều dòng) */
.rj-code-inp {
  display: block;
  resize: none;
  overflow: hidden;
  white-space: pre;
  line-height: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
#rj-ds-name, #rj-ds-code { height: 30px; line-height: 16px; }
.rj-ck--modal { width: 100%; min-height: 140px; }

/* Log lý do rejoin: giờ (mờ) · tên acc · lý do có màu theo loại */
.rj-log { white-space: normal; }
.rj-log-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 1px 0; }
.rj-log-t { color: var(--text-muted); font-variant-numeric: tabular-nums; flex: none; }
.rj-log-n { color: var(--text); font-weight: 600; flex: none; }
.rj-log-r { display: inline-flex; align-items: baseline; gap: 6px; color: var(--c); min-width: 0; }
.rj-log-r i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); flex: none; align-self: center; }
.rj-log-empty { color: var(--text-muted); }

/* ── AUTO VERSION ── */
.av-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .av-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .av-cards { grid-template-columns: 1fr; } }
.av-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 10px 12px;
  background: rgba(20,24,33,0.72);
  border: 1px solid rgba(0,180,255,.14);
  border-radius: 8px;
}
.av-card small { font: 700 12px/1.3 'Rajdhani', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.av-card b { font: 600 14px/1.4 ui-monospace, Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }
.av-card > span { font-size: 12.5px; color: var(--text-muted); }
.av-card .ok   { color: #4ade80; }
.av-card .warn { color: #fbbf24; }
.av-card .bad  { color: #f43f5e; }
.av-running { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-muted); }
.av-running code { font: 600 13px ui-monospace, Consolas, monospace; color: var(--text); }
.av-status { font-size: 13px; line-height: 1.45; color: var(--text); }

.av-dl { display: flex; flex-direction: column; gap: 6px; }
.av-dl[hidden] { display: none; }
.av-dl-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-muted); }
.av-dl-top b { color: rgb(0,220,255); font-variant-numeric: tabular-nums; }
.av-bar { height: 8px; border-radius: 999px; background: rgba(0,180,255,.08); border: 1px solid rgba(0,180,255,.18); overflow: hidden; }
.av-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(0,180,255,.6), rgb(0,230,255)); box-shadow: 0 0 10px rgba(0,210,255,.6); transition: width .4s ease; }

.av-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.av-chip { display: inline-flex; align-items: center; gap: 6px; }
.av-chip.on { border-color: rgba(0,220,255,.75); background: rgba(0,180,255,.18); color: #fff; box-shadow: 0 0 12px rgba(0,180,255,.25); }
.av-chip .ok  { color: #4ade80; }
.av-chip .bad { color: #f43f5e; }
.av-muted { color: var(--text-muted); font-size: 13px; }
.av-cur { color: #4ade80; }
.rj-btn--x.is-confirm { color: #fff; background: rgba(244,63,94,.35); border-color: #f43f5e; }

/* Nút chọn executor */
.av-pick { flex-wrap: wrap; gap: 10px; }
.av-pick-lb { color: var(--text-muted); font-weight: 600; }
.av-pick b { color: rgb(0,220,255); font-size: 15px; }
.av-pick-go { margin-left: auto; color: var(--text-muted); }

/* Bảng nổi chọn executor */
.av-m-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.av-m-latest { font-size: 13.5px; color: var(--text-muted); }
.av-m-latest b { font: 600 13.5px ui-monospace, Consolas, monospace; color: var(--text); }
.av-m-search { max-width: 260px; text-align: left; }
.av-m-tw { max-height: min(55vh, 520px); overflow: auto; border: 1px solid rgba(0,180,255,.14); border-radius: 8px; }
.av-m-tw thead th { position: sticky; top: 0; background: #0d1119; z-index: 1; }
.av-m-tw tbody tr { cursor: pointer; transition: background .12s; }
.av-m-tw tbody tr:hover, .av-m-tw tbody tr:focus-visible { background: rgba(0,180,255,.08); outline: none; }
.av-m-tw tbody tr.on { background: rgba(0,180,255,.16); box-shadow: inset 3px 0 0 rgb(0,220,255); }
.av-m-tw td code { font: 600 12.5px ui-monospace, Consolas, monospace; color: var(--text); }
.av-m-tw .ok { color: #4ade80; } .av-m-tw .bad { color: #f43f5e; } .av-m-tw .warn { color: #fbbf24; } .av-m-tw .mut { color: var(--text-muted); }
.av-m-tw .first td { border-bottom: 1px solid rgba(0,180,255,.25); }
.av-m-src { font-size: 11.5px; color: var(--text-muted); text-align: center; }
/* Nút chọn client: chữ nằm giữa */
.av-pick { justify-content: center; }
#av-pick-cur { color: rgb(0,220,255); font-size: 15px; font-weight: 700; }
