

body.admin { overflow: hidden; }

.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.dim-text { color: var(--dim); }
.win-text { color: var(--win); font-weight: 900; }
.hint { color: var(--dim); font-size: 13px; }

.btn-danger { --fill: var(--loss); --lip: #a3233f; --ink: #fff; }

.tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: var(--raised);
  color: var(--muted);
  text-transform: capitalize;
}
.tag-red { background: rgba(255, 90, 118, .18); color: var(--loss); }
.tag-gold { background: rgba(255, 203, 61, .16); color: var(--gold); }
.tag-violet { background: rgba(139, 92, 246, .2); color: var(--violet-hi); }

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: .92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--gem);
}



.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 10%, rgba(139, 92, 246, .22), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(255, 203, 61, .1), transparent 40%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px;
  border-width: 2px;
  box-shadow: 0 8px 0 #0a0620;
  animation: riseIn .5s cubic-bezier(.2, .8, .3, 1);
}

.login-logo { width: 64px; height: 64px; animation: bob 3.4s ease-in-out infinite; }
.login-card h1 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.login-sub { color: var(--muted); font-size: 14px; }
.form-error { min-height: 1.2em; color: var(--loss); font-weight: 800; font-size: 14px; }



.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.admin-nav .brand-icon { width: 38px; height: 38px; }
.brand-stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.brand-stack .brand-wordmark { max-width: 130px; }
.brand-tag { font-size: 11px; font-weight: 900; color: var(--violet-hi); }
.login-wordmark { width: 100%; max-width: 260px; height: auto; margin-top: -4px; }
.admin-nav nav { display: flex; flex-direction: column; gap: 2px; }

.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #3a2500;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.nav-count:empty { display: none; }

.admin-nav-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  font-size: 13px;
  color: var(--dim);
}
.admin-nav-footer strong { color: var(--text); }

.admin-main { overflow-y: auto; padding: 28px 32px 56px; }
.admin-main > * { max-width: 1280px; margin-inline: auto; }

.admin-section { display: none; }
.admin-section.active { display: block; animation: viewIn .2s ease-out; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
}
.section-head .view-sub { flex-basis: 100%; }

.sub-title { font-size: 16px; font-weight: 900; margin: 24px 0 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }



.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  animation: riseIn .35s ease-out backwards;
  animation-delay: calc(var(--i) * 40ms);
}
.stat-tile span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-tile strong { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2; }
.stat-tile small { color: var(--dim); font-size: 12px; font-weight: 700; }

.list-panel { padding: 16px 18px; }
.list-panel h3, .stack-form h3 { font-size: 16px; font-weight: 900; margin-bottom: 8px; }

.mini-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  min-width: 0;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row img { width: 26px; height: 26px; border-radius: 8px; flex: none; background: var(--raised); }
.mini-row > span:first-of-type { flex: 1; min-width: 0; }
.mini-row time { margin-left: auto; color: var(--dim); font-size: 12px; white-space: nowrap; }
.chat-row .grow { overflow-wrap: anywhere; }



.lookup-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 18px;
  border-width: 2px;
  border-color: var(--line-2);
}

.lookup-bar + .hint { margin: 8px 4px 16px; }

.players-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 12px;
  align-items: start;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 6px;
}

.table-tools .filter-controls { margin: 0; }
.input-with-icon.small { height: 38px; flex: 1 1 200px; max-width: 280px; }

.custom-table.clickable tbody tr { cursor: pointer; transition: background-color .12s; }
.custom-table.clickable tbody tr:hover { background: rgba(139, 92, 246, .08); }
.custom-table.clickable tbody tr.selected { background: rgba(139, 92, 246, .16); box-shadow: inset 3px 0 0 var(--violet); }
.custom-table td small { display: block; font-size: 11px; color: var(--dim); font-weight: 700; }
.custom-table td, .custom-table th { padding-left: 16px; padding-right: 16px; }

.player-panel {
  position: sticky;
  top: 0;
  padding: 18px;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}

.player-panel .empty-state { border: 0; background: none; padding: 40px 12px; }
.player-panel.opened > * { animation: riseIn .3s ease-out backwards; }
.player-panel.opened > *:nth-child(2) { animation-delay: .04s; }
.player-panel.opened > *:nth-child(3) { animation-delay: .08s; }
.player-panel.opened > *:nth-child(4) { animation-delay: .12s; }
.player-panel.opened > *:nth-child(5) { animation-delay: .16s; }
.player-panel.opened > *:nth-child(6) { animation-delay: .2s; }

.player-head { display: flex; align-items: center; gap: 14px; }
.player-avatar { width: 64px; height: 64px; border-radius: 18px; border: 3px solid var(--line-2); background: var(--raised); }
.player-id { flex: 1; min-width: 0; }
.player-id h3 { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.player-id h3 small { font-family: var(--body); font-size: 13px; color: var(--dim); font-weight: 700; }
.player-id > span { font-size: 12px; color: var(--dim); font-weight: 700; }
.player-id a { color: var(--violet-hi); }
.player-tags { margin-top: 4px; }

.player-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.player-stats > div {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
}
.player-stats span { font-size: 12px; color: var(--muted); font-weight: 700; }
.player-stats strong { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.2; display: inline-block; }
.player-stats small { font-size: 11px; color: var(--dim); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }

.notice {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 203, 61, .1);
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 12px;
}

.player-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.player-block h4 { font-size: 15px; font-weight: 900; }
.player-block h4 small { color: var(--dim); font-weight: 700; font-size: 13px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.level-row { margin-left: auto; }
.input-with-icon.count { width: 84px; flex: none; }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
}
.seg-btn { height: 34px; border-radius: 9px; font-weight: 800; color: var(--muted); font-size: 14px; }
.seg-btn.active { background: var(--raised); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--violet); }

.admin-inventory { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }

.admin-pet {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 8px;
  border-radius: 12px;
  background: var(--bg);
}
.admin-pet > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-pet strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-pet span:not(.pet-img) { font-size: 12px; color: var(--gem); font-weight: 800; }

.icon-btn.danger:hover { color: var(--loss); background: rgba(255, 90, 118, .12); }



.pet-picker { position: relative; }

.picker-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: none;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 2px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 6px 0 #0a0620;
}
.picker-results.open { display: block; animation: riseIn .15s ease-out; }

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.picker-item .pet-img { width: 34px; height: 34px; }
.picker-item span:not(.pet-img) { flex: 1; min-width: 0; }
.picker-item strong { color: var(--gem); font-size: 13px; }
.picker-item:hover, .picker-item.active { background: var(--raised); }
.picker-empty { padding: 10px; color: var(--dim); font-size: 14px; }



.inline-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.inline-form .form-group:not(.grow) { width: 160px; }

.admin-giveaways .giveaway-card.ended { opacity: .6; }

.pet-row { display: flex; gap: 2px; }
.pet-row .pet-img { width: 30px; height: 30px; }

.stack-form { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.stack-form .hint { margin-top: -6px; }
.stack-form .btn { align-self: flex-start; }

textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
  outline: none;
}
textarea:focus { border-color: var(--violet); }

#sec-chat .list-panel { margin-top: 12px; }



.confirm-card { max-width: 420px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

.quick-amounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.treasury-result-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--violet);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fee-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.breakdown-info strong {
  color: var(--text);
  font-weight: 800;
}

.breakdown-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gem), var(--violet-hi));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.bot-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.bot-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--violet);
  background: var(--bg);
}

.bot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.bot-info strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-info span {
  font-size: 12px;
}

.bot-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: 10px;
}

.bot-stats-row > div {
  display: flex;
  flex-direction: column;
}

.bot-stats-row span {
  font-size: 11px;
  color: var(--dim);
}

.bot-stats-row strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 800;
}

.bot-active-trade {
  font-size: 12px;
  color: var(--gold);
  background: rgba(255, 203, 61, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
}

.bot-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}



@media (max-width: 1180px) {
  .players-layout { grid-template-columns: 1fr; }
  .player-panel { position: static; max-height: none; order: -1; }
}

@media (max-width: 860px) {
  body.admin { overflow: auto; }
  .admin-layout { grid-template-columns: 1fr; height: auto; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav .brand-section { padding: 0 8px 0 0; }
  .admin-nav nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  .admin-nav nav .nav-item { width: auto; white-space: nowrap; }
  .admin-nav-footer { flex-direction: row; align-items: center; margin: 0 0 0 auto; padding: 0; }
  .admin-nav-footer > span { display: none; }
  .admin-main { padding: 20px 16px 48px; overflow: visible; }
  .two-col { grid-template-columns: 1fr; }
  .lookup-bar { flex-direction: column; align-items: stretch; }
  .player-stats { grid-template-columns: 1fr 1fr; }
  .level-row { margin-left: 0; }
}

.bot-card.bot-banned { border-color: #ef4444; box-shadow: 0 0 16px rgba(239, 68, 68, 0.2); }
.tag-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.pet-cell { display: flex; align-items: center; gap: 8px; }
.pet-cell img { width: 28px; height: 28px; object-fit: contain; }
.pet-cell .gem-icon { width: 20px; height: 20px; }
