/* woda admin widgets: catalog, cart, cosmetics (public/admin-ui.js) */
:root {
  --rar-E: #8a97a8;
  --rar-C: #4cc38a;
  --rar-B: #3f8cff;
  --rar-A: #9b6bff;
  --rar-S: #ffb23f;
  --rar-R: #ff5d6c;
  --rar-U: #ff6fd8;
}

.w-player-head { display: flex; align-items: flex-start; gap: 16px; }
.w-player-head .admin-head { flex: 1; min-width: 0; }
.w-avatar { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--admin-line); }

.w-small { min-height: 30px !important; padding: 4px 10px !important; font-size: 12px; }

/* currency cards */
.w-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 18px; }
.w-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 34, 56, .95), rgba(11, 20, 35, .95));
  border: 1px solid var(--admin-line);
}
.w-card img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.w-card-text { display: grid; min-width: 0; }
.w-card-text span { color: #9fb2ca; font-size: 12px; }
.w-card-text b { color: #f4f8ff; font-size: 20px; line-height: 1.2; }
.w-card-text small { color: #6f8199; font-size: 11px; }

/* equipped cosmetics */
.w-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.w-slot { display: grid; gap: 6px; }
.w-slot-button {
  display: grid; justify-items: center; gap: 4px; width: 100%; min-height: 168px; padding: 12px 8px !important;
  color: #eaf2ff !important; background: rgba(255, 255, 255, .04) !important; border: 1px solid var(--admin-line) !important;
  border-radius: 10px; box-shadow: none !important; text-transform: none; cursor: pointer;
}
.w-slot-button:hover { border-color: rgba(98, 140, 255, .6) !important; background: rgba(98, 140, 255, .1) !important; }
.w-slot-button img { width: 92px; height: 92px; object-fit: contain; }
.w-slot-empty { width: 92px; height: 92px; display: grid; place-items: center; color: #4d5f78; font-size: 36px; }
.w-slot-title { color: #9fb2ca; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.w-slot-name { font-size: 13px; text-align: center; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-slot-actions { display: flex; justify-content: center; margin: 0; min-height: 30px; }

/* rarity accents */
.rarity-E { --rar: var(--rar-E); }
.rarity-C { --rar: var(--rar-C); }
.rarity-B { --rar: var(--rar-B); }
.rarity-A { --rar: var(--rar-A); }
.rarity-S { --rar: var(--rar-S); }
.rarity-R { --rar: var(--rar-R); }
.rarity-U { --rar: var(--rar-U); }
.w-slot-button[class*="rarity-"],
.w-tile[class*="rarity-"],
.w-own[class*="rarity-"],
.w-chip[class*="rarity-"] { box-shadow: inset 0 -3px 0 var(--rar) !important; }

/* modal + catalog */
.w-modal {
  position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(2, 6, 12, .74); backdrop-filter: blur(6px);
}
.w-modal.visible { display: flex; }
.w-modal-panel {
  width: min(1100px, calc(100vw - 40px)); height: min(860px, calc(100vh - 40px)); display: flex; flex-direction: column; gap: 12px;
  padding: 20px; border-radius: 12px; color: #eaf2ff; background: linear-gradient(180deg, #121f34, #08101d);
  border: 1px solid rgba(255, 211, 106, .22); box-shadow: 0 30px 100px rgba(0, 0, 0, .5);
}
.w-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.w-modal-head h3 { margin: 0; }
.w-catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.w-catalog-filters button {
  min-height: 30px; padding: 4px 12px; font-size: 12px; color: #c7d6ea; background: transparent; border: 1px solid var(--admin-line); box-shadow: none;
}
.w-catalog-filters button.active { color: #fff; background: rgba(98, 140, 255, .2); border-color: rgba(98, 140, 255, .55); }
.w-catalog-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.w-catalog-section h4 { margin: 14px 0 8px; color: #ffd36a; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.w-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.w-tile {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 140px; padding: 10px 6px !important;
  color: #eaf2ff !important; background: rgba(255, 255, 255, .045) !important; border: 1px solid rgba(146, 185, 255, .12) !important;
  border-radius: 8px; text-transform: none; cursor: pointer; font-weight: 600;
}
.w-tile:hover { background: rgba(98, 140, 255, .14) !important; border-color: rgba(98, 140, 255, .5) !important; }
.w-tile img { width: 72px; height: 72px; object-fit: contain; }
.w-tile-name { font-size: 12px; line-height: 1.2; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-tile-meta { color: #7f93ad; font-size: 10px; text-align: center; }
.w-tile.is-owned { border-color: rgba(76, 195, 138, .55) !important; }
.w-tile.is-current { outline: 2px solid #ffd36a; }
.w-tile-badge {
  position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px;
  color: #062014; background: #4cc38a;
}

/* cart */
.w-cart-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.w-quick { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.w-cart-flash { color: #7ff0bd; font-size: 13px; opacity: 0; transition: opacity .2s; }
.w-cart-flash.visible { opacity: 1; }
.w-basket { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-bottom: 12px; }
.w-chip {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 96px 30px; align-items: center; gap: 8px; padding: 8px;
  border-radius: 8px; background: rgba(255, 255, 255, .05); border: 1px solid var(--admin-line);
}
.w-chip img { width: 44px; height: 44px; object-fit: contain; }
.w-chip-label { display: grid; min-width: 0; }
.w-chip-label b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-chip-label small { color: #7f93ad; font-size: 11px; }
.w-chip input { width: 96px !important; min-height: 34px !important; padding: 4px 8px !important; }
.w-chip-remove {
  min-height: 30px !important; padding: 0 !important; color: #ff9eab !important; background: transparent !important;
  border: 0 !important; box-shadow: none !important; font-size: 20px;
}
.w-cart-reason { display: grid; gap: 6px; max-width: 520px; margin-bottom: 10px; color: #9fb2ca; font-size: 13px; }

/* owned items */
.w-own-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.w-own {
  display: grid; justify-items: center; align-content: start; gap: 4px; padding: 10px 8px; border-radius: 8px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(146, 185, 255, .12); text-align: center;
}
.w-own.is-current { border-color: rgba(255, 211, 106, .6); }
.w-own img { width: 72px; height: 72px; object-fit: contain; }
.w-own b { font-size: 12px; line-height: 1.2; }
.w-own small { color: #7f93ad; font-size: 11px; }
.w-own form { margin: 0; }
.w-own-actions { display: flex; gap: 6px; justify-content: center; }
.w-own-form { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: end; }
.w-own-form label { display: grid; gap: 2px; font-size: 10px; color: #7f93ad; }
.w-own-form input { width: 58px !important; min-height: 30px !important; padding: 2px 6px !important; }

.w-details { margin-bottom: 18px; }
.w-details > summary { cursor: pointer; padding: 10px 0; color: #9fb2ca; font-weight: 700; }

.w-hero-cell { display: flex; align-items: center; gap: 10px; }
.w-hero-cell img { width: 56px; height: 32px; object-fit: cover; border-radius: 4px; }

.w-pick-one { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.w-pick-preview { display: flex; align-items: center; gap: 8px; min-height: 40px; color: #c7d6ea; font-size: 13px; }
.w-pick-preview img { width: 40px; height: 40px; object-fit: contain; }

.admin-player-cell { display: inline-flex; align-items: center; gap: 8px; }

.is-admin .pagination a,
.is-admin .pagination-gap {
  color: #c7d6ea;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--admin-line);
  box-shadow: none;
}
.is-admin .pagination a.active,
.is-admin .pagination a:hover {
  color: #fff;
  background: rgba(98, 140, 255, .25);
  border-color: rgba(98, 140, 255, .55);
}

.admin-player-cell img.tiny-icon { width: 28px; height: 28px; border-radius: 6px; }

/* hero win-rate (style of the old world-of-dota.com statistics page) */
.wr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.wr-filters input[name="q"] { width: 240px; }
.wr-filters label { display: inline-flex; align-items: center; gap: 6px; color: #9fb2ca; font-size: 13px; }
.wr-filters input[name="min"] { width: 90px; }
.wr-tabs { align-items: center; color: #9fb2ca; font-size: 13px; }
.wr-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.wr-head, .wr-row { display: grid; grid-template-columns: minmax(220px, 300px) 150px minmax(420px, 1fr); align-items: center; gap: 16px; }
.wr-head { padding: 8px 12px; color: #9fb2ca; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--admin-line); }
.wr-row { padding: 10px 12px; border-bottom: 1px solid rgba(146, 185, 255, .07); }
.wr-row:hover { background: rgba(98, 140, 255, .06); }
.wr-hero { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wr-hero b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-hero-img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; flex: none; }
.wr-attr { width: 22px; height: 22px; flex: none; }
.wr-attr-big { width: 44px; height: 44px; flex: none; }
.wr-games { display: grid; color: #f4f8ff; font-size: 18px; font-weight: 800; }
.wr-games small { color: #7f93ad; font-size: 11px; font-weight: 500; }
.wr-bars { display: flex; gap: 8px; align-items: stretch; }
.wr-col { display: grid; grid-template-rows: auto 56px auto; justify-items: center; gap: 3px; width: 44px; }
.wr-pct { color: #c7d6ea; font-size: 11px; }
.wr-track { width: 34px; height: 56px; display: flex; align-items: flex-end; background: rgba(255, 255, 255, .04); border-radius: 4px; overflow: hidden; }
.wr-fill { display: block; width: 100%; border-radius: 4px 4px 0 0; }
.wr-place { color: #7f93ad; font-size: 11px; }
.wr-p0 { background: #14b88f; } .wr-p1 { background: #66b814; } .wr-p2 { background: #8fb814; } .wr-p3 { background: #b8b814; }
.wr-p4 { background: #b88f14; } .wr-p5 { background: #b86614; } .wr-p6 { background: #b83d14; } .wr-p7 { background: #8f14b8; }
.wr-row-attr .wr-games { font-size: 20px; }

/* season reward tiers */
.w-tier-board { margin-bottom: 22px; }
.w-tier-board h3 { margin: 0 0 10px; }
.w-tier { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 10px; margin-bottom: 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(146, 185, 255, .1); }
.w-tier-places { display: flex; align-items: center; gap: 6px; color: #9fb2ca; font-size: 13px; }
.w-tier-places input { width: 70px !important; min-height: 34px !important; padding: 4px 8px !important; }
.w-tier-basket { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.w-chip-small { grid-template-columns: 32px auto 90px 26px; padding: 4px 6px; }
.w-chip-small img { width: 32px; height: 32px; }
.w-chip-name { font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-reward-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.w-reward-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12px; }
.w-reward-chip img { width: 24px; height: 24px; object-fit: contain; }

.w-promo-item { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.w-promo-item > label { min-width: 220px; }
.promo-tab-panel.hidden { display: none; }
.admin-row-actions form { margin: 0; }

.admin-row-actions { flex-wrap: nowrap; }
.admin-row-actions .button,
.admin-row-actions button,
.admin-row-actions a.ghost {
  min-height: 32px !important;
  padding: 6px 12px !important;
  font-size: 12px;
  white-space: nowrap;
}

.admin-form label.checkbox-label,
.promocode-form label.checkbox-label { display: flex; align-items: center; gap: 10px; color: #c7d6ea; font-size: 14px; }
label.checkbox-label input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; flex: none; }

/* Servers page (/admin/servers): pool orchestrators, hosts, lobbies */
.srv-root { --srv-free: #1fb876; --srv-busy: #2aa8ff; --srv-reserved: #e4aa37; --srv-starting: #9a6dff; --srv-down: #e74f5f; --srv-other: #5b6b82; }
.srv-root [hidden] { display: none !important; }
.srv-root .srv-table { min-width: 0; }
.srv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.srv-tile { display: grid; gap: 4px; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--admin-line); background: linear-gradient(180deg, rgba(16, 27, 45, .96), rgba(9, 17, 30, .98)); }
.srv-tile span { color: #9fb2ca; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.srv-tile b { color: #f4f8ff; font-size: 28px; line-height: 1.1; }
.srv-tile small { color: #8597ad; font-size: 12px; }
.srv-hosts { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; }
.srv-host .admin-card-head { margin-bottom: 10px; }
.srv-host h2 { display: flex; align-items: center; gap: 8px; }
.srv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--srv-free); display: inline-block; }
.srv-dot.off { background: var(--srv-down); }
.srv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin: 4px 0; color: #9fb2ca; }
.srv-row b { color: #f4f8ff; }
.srv-bar { height: 6px; border-radius: 3px; overflow: hidden; background: rgba(0, 0, 0, .35); margin: 4px 0 10px; }
.srv-bar i { display: block; height: 100%; background: var(--srv-busy); }
.srv-bar i.warn { background: var(--srv-reserved); }
.srv-bar i.crit { background: var(--srv-down); }
.srv-cell-bar { min-width: 160px; }
.srv-cell-bar .srv-bar { margin: 4px 0 0; }
.srv-pools-box { margin: 12px 0 8px; padding: 10px 12px 2px; border-radius: 8px; background: rgba(0, 0, 0, .18); border: 1px solid rgba(146, 185, 255, .08); }
.srv-pool-row { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 0 12px; font-size: 13px; }
.srv-pool-row span { color: #c7d6ea; }
.srv-pool-row b { color: #f4f8ff; text-align: right; }
.srv-pool-row em { grid-column: 1 / -1; color: #8597ad; font-style: normal; font-size: 12px; }
.srv-pool-row .srv-bar { grid-column: 1 / -1; margin: 3px 0 9px; }
.srv-counts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: #9fb2ca; margin: 10px 0 6px; }
.srv-counts span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; background: var(--srv-other); }
.srv-counts .free::before { background: var(--srv-free); }
.srv-counts .busy::before { background: var(--srv-busy); }
.srv-counts .reserved::before { background: var(--srv-reserved); }
.srv-counts .starting::before { background: var(--srv-starting); }
.srv-counts .down::before { background: var(--srv-down); }
.srv-grid-label { color: #8597ad; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 4px; }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, 22px); gap: 4px; }
.srv-cell { width: 22px; height: 22px; border-radius: 4px; background: var(--srv-other); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; cursor: default; }
.srv-cell.free { background: var(--srv-free); color: #07101c; }
.srv-cell.busy { background: var(--srv-busy); }
.srv-cell.reserved { background: var(--srv-reserved); color: #07101c; }
.srv-cell.starting { background: var(--srv-starting); }
.srv-cell.down { background: var(--srv-down); }
.srv-cell.ending, .srv-cell.idle { background: #60a5fa; }
.srv-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
@media (max-width: 1100px) { .srv-two { grid-template-columns: 1fr; } .srv-hosts { grid-template-columns: 1fr; } }
.srv-chart { width: 100%; height: 220px; display: block; }
.srv-line { fill: none; stroke-width: 1.5; }
.srv-line.humans { stroke: var(--srv-busy); stroke-width: 2.2; }
.srv-line.arena { stroke: #5eead4; stroke-dasharray: 5 4; }
.srv-line.rating { stroke: var(--srv-starting); stroke-dasharray: 5 4; }
.srv-line.queue { stroke: var(--srv-reserved); }
.srv-line.free { stroke: var(--srv-free); opacity: .7; }
.srv-legend { color: #9fb2ca; font-size: 12px; margin-top: 6px; }
.srv-legend i { display: inline-block; width: 14px; height: 3px; margin: 0 6px 0 10px; vertical-align: middle; }
.srv-legend .l-humans { background: var(--srv-busy); }
.srv-legend .l-arena { background: #5eead4; }
.srv-legend .l-rating { background: var(--srv-starting); }
.srv-legend .l-queue { background: var(--srv-reserved); }
.srv-legend .l-free { background: var(--srv-free); }
.srv-scroll { max-height: 560px; overflow: auto; }
.srv-versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; font-size: 13px; color: #c7d6ea; }
.srv-version b { color: #f4f8ff; }
.srv-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-word; }
.srv-nowrap { white-space: nowrap; }
.srv-err { color: #ff9eab; }
.srv-hot { color: #ff9eab; font-weight: 700; }
.srv-warm { color: #ffd88a; }
.srv-check { cursor: pointer; }
.srv-check input { width: auto; min-height: 0; vertical-align: middle; }
.srv-found { margin-top: 14px; }
.srv-kv { margin-top: 12px; padding: 12px; border-radius: 8px; background: rgba(0, 0, 0, .18); }
.srv-actions { margin-top: 12px; }
.srv-note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .25); color: #e9f1ff; white-space: pre-wrap; font-size: 13px; }

/* Currency stats (/admin/currencies) */
.is-admin .currency-table { min-width: 0; }
.currency-scroll { overflow-x: auto; }
.currency-scroll .currency-table { min-width: 980px; }
.currency-sort a { color: inherit; text-decoration: none; white-space: nowrap; }
.currency-sort a:hover { color: #fff; }
.currency-sort.active a { color: #f4f8ff; }
.currency-table td.currency-active { color: #f4f8ff; font-weight: 800; }
.currency-table td.currency-negative { color: #ff9eab; font-weight: 800; }
