.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.page-head p {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  height: 0;
}

.tabs button {
  flex: none;
}

.tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.on {
  background: var(--red);
  color: #fff;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar .grow {
  flex: 1;
}

.toolbar .input-wrap {
  min-width: 220px;
}

.toolbar input.control,
.toolbar select.control {
  height: 42px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  padding: 13px 18px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
  background: #131316;
  border-bottom: 1px solid var(--line-soft);
  z-index: 2;
}

.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1f;
}

.data-table tbody tr {
  transition: background 0.13s;
}

.data-table tbody tr:hover {
  background: #17171b;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
}

.cell-name img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #2c2c34;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
}

.seats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seats-track {
  width: 68px;
  height: 6px;
  border-radius: 4px;
  background: #24242c;
  overflow: hidden;
}

.seats-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3cc063, #1e7a38);
}

.match-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  padding: 20px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.option-group > span {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.14s;
}

.chip-row button:hover {
  color: var(--text);
  border-color: #34343e;
}

.chip-row button.on {
  background: rgba(211, 47, 47, 0.14);
  border-color: var(--red);
  color: #f08b88;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 16px;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  transition: border-color 0.16s, transform 0.16s;
}

.info-card:hover {
  border-color: #2c2c34;
  transform: translateY(-2px);
}

.info-card h3 {
  font-size: 16px;
  font-weight: 700;
}

.info-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.info-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.info-card .kv {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid #1b1b21;
}

.info-card .kv:last-of-type {
  border-bottom: none;
}

.info-card .kv span {
  color: var(--text-dim);
}

.info-card .kv b {
  font-weight: 650;
}

.promo-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

.promo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
}

.promo-card.red::before {
  background: radial-gradient(90% 120% at 100% 0%, rgba(211, 47, 47, 0.35), transparent 60%);
}

.promo-card.gold::before {
  background: radial-gradient(90% 120% at 100% 0%, rgba(212, 165, 52, 0.3), transparent 60%);
}

.promo-card.purple::before {
  background: radial-gradient(90% 120% at 100% 0%, rgba(139, 92, 246, 0.3), transparent 60%);
}

.promo-card > * {
  position: relative;
}

.badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: var(--red);
  color: #fff;
  z-index: 2;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(172px, 100%), 1fr));
  gap: 14px;
}

.stat-tiles > * {
  min-width: 0;
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.stat-tile .ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: none;
}

.stat-tile b {
  display: block;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.stat-tile span {
  font-size: 12.5px;
  color: var(--text-dim);
}

.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

.split-2 > * {
  min-width: 0;
}

.panel-pad {
  padding: 20px;
}

.list-rows {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1f;
  font-size: 13.5px;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row .ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
  background: var(--panel-3);
  color: var(--text-dim);
}

.list-row .amount {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.amount.plus {
  color: var(--green);
}

.amount.minus {
  color: #ef6a68;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
}

.status-dot.completed i {
  background: var(--green);
}

.status-dot.pending i,
.status-dot.confirming i {
  background: var(--gold);
}

.status-dot.failed i,
.status-dot.cancelled i {
  background: var(--red);
}

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px;
  background: #101013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qr-block canvas,
.qr-block .qr-shell {
  width: 168px;
  height: 168px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.address-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #0d0d10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.address-line button {
  margin-left: auto;
  color: var(--text-mute);
  flex: none;
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
}

.address-line button:hover {
  color: var(--text);
}

.progress {
  height: 7px;
  border-radius: 4px;
  background: #24242c;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--red-bright), var(--red-deep));
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #1a1a1f;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row .txt b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.setting-row .txt span {
  font-size: 12.5px;
  color: var(--text-dim);
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: none;
}

.switch input {
  appearance: none;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: #26262e;
  cursor: pointer;
  transition: background 0.18s;
}

.switch input:checked {
  background: var(--red);
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}

.switch input:checked::after {
  transform: translateX(22px);
}

@media (max-width: 1000px) {
  .split-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .page-head {
    align-items: stretch;
  }
  .page-head h1 {
    font-size: 21px;
  }
  .toolbar .input-wrap {
    min-width: 0;
    width: 100%;
  }
  .info-card,
  .panel-pad {
    padding: 16px;
  }
  .list-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 11px 12px;
  }
}


.profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-header > img {
  flex: none;
}

.profile-meta {
  flex: 1 1 200px;
  min-width: 0;
}

.profile-meta > div {
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .profile-header {
    gap: 14px;
  }

  .profile-header > img {
    width: 64px !important;
    height: 64px !important;
  }

  .profile-header .btn {
    width: 100%;
  }
}

.toolbar {
  align-items: flex-end;
  row-gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.filter-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.toolbar-tail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-form .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-note {
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.55;
}

@media (max-width: 760px) {
  .toolbar-tail {
    margin-left: 0;
    width: 100%;
  }

  .toolbar-tail .btn {
    flex: 1;
  }

  .filter-group {
    width: 100%;
  }

  .create-form .grid-2 {
    grid-template-columns: 1fr;
  }
}


.btn-row {
  height: 34px;
  padding: 0 20px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
}

tr:hover .btn-row {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.data-table thead th {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--text-mute);
}

.data-table tbody td {
  border-bottom: 1px solid var(--line-soft);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

.seats-track {
  background: rgba(255, 255, 255, 0.07);
}

.seats-track i {
  background: var(--gold);
}

.tabs {
  background: var(--panel);
  border-color: var(--line);
}

.tabs button.on {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tabs button.on::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1.5px;
  background: var(--gold);
}

.tabs button {
  position: relative;
}

.chip-row button.on {
  background: rgba(201, 169, 97, 0.12);
  border-color: rgba(201, 169, 97, 0.4);
  color: var(--gold-soft);
}

.page-head h1 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.page-head p {
  font-size: 13px;
  color: var(--text-mute);
}

.stat-tile {
  background: var(--panel);
  border-color: var(--line);
}

.stat-tile .ic {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--line);
  color: var(--text-dim) !important;
}

.stat-tile b {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.stat-tile span {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.info-card {
  background: var(--panel);
  border-color: var(--line);
}

.info-card:hover {
  border-color: rgba(201, 169, 97, 0.28);
  transform: none;
}

.list-row {
  border-bottom: 1px solid var(--line-soft);
}

.list-row .ic {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.lobby-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.lobby-filters .chip-row.soft button:not(.on) {
  color: var(--text-mute);
}

.lobby-filters-tail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-filters-tail .input-wrap {
  width: 220px;
}

.cash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 92px 108px auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.cash-row:hover {
  border-color: rgba(201, 169, 97, 0.4);
  background: linear-gradient(180deg, rgba(201, 169, 97, 0.09), rgba(255, 255, 255, 0.02));
  transform: translateY(-1px);
}

.cash-blinds b {
  display: block;
  font-size: 17px;
  font-weight: 750;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.cash-blinds span,
.cash-name span,
.cash-stat span {
  font-size: 11.5px;
  color: var(--text-mute);
  letter-spacing: 0.3px;
}

.cash-name b {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
}

.cash-stat {
  text-align: center;
}

.cash-stat b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cash-row .btn-row {
  pointer-events: none;
}

/* кнопки в конце строки: смотреть матч и сесть за стол */
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.open-row,
.duel-row {
  cursor: pointer;
}

.duel-row.busy {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 860px) {
  .lobby-filters {
    gap: 8px;
  }

  .lobby-filters .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: 2px;
  }

  .lobby-filters .chip-row::-webkit-scrollbar {
    display: none;
  }

  .lobby-filters .chip-row button {
    flex: none;
  }

  .cash-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "blinds join" "name name" "stats stats";
    gap: 10px 12px;
    padding: 13px 15px;
  }

  .cash-blinds {
    grid-area: blinds;
  }

  .cash-name {
    grid-area: name;
  }

  .cash-row .btn-row,
  .cash-row .row-actions {
    grid-area: join;
  }

  .cash-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }

  .cash-stat:nth-of-type(3) {
    grid-area: stats;
    justify-self: start;
  }

  .cash-stat:nth-of-type(4) {
    grid-area: stats;
    justify-self: end;
  }

  .lobby-filters-tail {
    width: 100%;
    margin-left: 0;
  }

  .lobby-filters-tail .input-wrap {
    flex: 1 1 100%;
    width: auto;
  }

  .lobby-filters-tail {
    flex-wrap: wrap;
  }

  .lobby-filters-tail .btn {
    flex: 1;
    min-width: 0;
  }
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.filter-grid button {
  padding: 10px 6px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.filter-grid button:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.filter-grid button.on {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(224, 32, 62, 0.22), rgba(224, 32, 62, 0.1));
  color: #fff;
  box-shadow: 0 4px 16px rgba(224, 32, 62, 0.22);
}

.duel-row .seat-open {
  color: var(--green-bright);
}

@media (max-width: 860px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.private-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.private-form .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.private-form .field > span {
  font-size: 11.5px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.private-link {
  display: flex;
  gap: 8px;
}

.private-link[hidden] {
  display: none;
}

.private-link input {
  flex: 1;
  font-size: 12.5px;
}

.admin-panel {
  padding: 18px;
  margin-bottom: 16px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-head b {
  font-size: 15px;
}

.admin-texts {
  display: grid;
  gap: 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-field span {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.admin-field i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-mute);
}

.admin-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}

.admin-avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.admin-avatar {
  position: relative;
  margin: 0;
  text-align: center;
}

.admin-avatar img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-avatar figcaption {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-avatar button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 8, 10, 0.86);
  color: var(--red-bright);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.admin-builtin {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-builtin span {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.admin-builtin div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.admin-builtin img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.upload-btn {
  cursor: pointer;
}

.raffle-card {
  margin: 16px 0;
}

.raffle-prize {
  font-size: 34px;
  font-weight: 800;
  color: var(--gold-soft);
  margin: 4px 0 6px;
}

.raffle-note {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.raffle-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.raffle-stats div {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.raffle-stats b {
  display: block;
  font-size: 19px;
  font-weight: 750;
}

.raffle-stats span {
  font-size: 11.5px;
  color: var(--text-mute);
}

.raffle-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
}

.raffle-winners i {
  font-style: normal;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 169, 97, 0.12);
  color: var(--gold-soft);
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.gift-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  align-items: center;
}

.gift-card.ready {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 169, 97, 0.18);
}

.gift-card.done {
  opacity: 0.55;
}

.gift-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(201, 169, 97, 0.14);
  color: var(--gold-soft);
}

.gift-card span {
  font-size: 12px;
  color: var(--text-mute);
}

.gift-card .btn {
  width: 100%;
}

/* ---- фильтры лобби: две подписанные группы вместо общей сетки ---- */

.filter-sets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.filter-set {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.filter-caption {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
}

.seg-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.seg-row::-webkit-scrollbar {
  display: none;
}

.seg-row button {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}

.seg-row button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.seg-row button.on {
  color: #fff;
  border-color: rgba(224, 32, 62, 0.55);
  background: linear-gradient(180deg, rgba(224, 32, 62, 0.3), rgba(224, 32, 62, 0.14));
  box-shadow: 0 3px 12px rgba(224, 32, 62, 0.2);
}

@media (max-width: 860px) {
  .filter-sets {
    width: 100%;
    gap: 8px;
  }

  .filter-set {
    width: 100%;
    gap: 7px;
  }

  .seg-row {
    flex: 1;
    min-width: 0;
  }

  .seg-row button {
    padding: 7px 11px;
    font-size: 12px;
  }
}

.lobby-filters .filter-sets {
  flex: 1 1 auto;
  min-width: 0;
}

.lobby-filters .lobby-filters-tail {
  flex: 0 0 auto;
}

.lobby-filters-tail .input-wrap {
  width: 190px;
}

.stat-tile.tile-flat {
  background: var(--panel-2);
}

/* ---- наблюдение за столами в админке ---- */

.watch-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
}

.watch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow-y: auto;
}

.watch-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  text-align: left;
}

/* сам стол открывается раскладом, ссылка рядом — живой просмотр матча */
.watch-pick {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.watch-live {
  align-self: flex-start;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  gap: 6px;
}

.watch-row b,
.watch-pick b {
  color: var(--text);
  font-size: 13px;
}

.watch-row span {
  font-size: 11.5px;
}

.watch-row i {
  font-style: normal;
  font-size: 11px;
  color: var(--text-mute);
}

.watch-row.on {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(224, 32, 62, 0.16), rgba(224, 32, 62, 0.06));
}

.watch-smode {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 4px;
}

.watch-smode label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.watch-smode select.control {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 6px 28px 6px 8px;
}

.watch-smode .btn {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}

.watch-smode small {
  color: var(--text-mute);
}

.watch-bots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.watch-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.watch-xray {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.watch-xray.on {
  color: var(--red);
  background: rgba(224, 32, 62, 0.1);
}

.watch-xray.off {
  color: var(--green-bright);
  background: rgba(53, 201, 127, 0.08);
}

.watch-xray.unknown,
.watch-update {
  color: var(--text-mute);
  font-size: 11px;
}

.watch-update.stale {
  color: var(--red);
}

.watch-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
}

.watch-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.watch-head b {
  font-size: 15px;
}

.watch-head span {
  color: var(--text-dim);
  font-size: 12.5px;
}

.watch-board {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
}

.watch-board.next {
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.watch-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #f4f4f8;
  color: #14151a;
  font-weight: 800;
  font-size: 12.5px;
}

.watch-card.red {
  color: #c8102e;
}

.watch-seats {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.watch-seats th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-mute);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.watch-seats td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.watch-seats tr.acting td {
  background: rgba(53, 201, 127, 0.08);
}

.watch-seats i {
  font-style: normal;
  color: var(--text-mute);
  font-size: 11px;
}

@media (max-width: 860px) {
  .watch-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-list {
    max-height: 220px;
  }
}

/* --- партнёрская программа --- */
.partner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.partner-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.partner-intro p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 4px;
}

.partner-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.partner-steps > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.partner-steps b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
}

.partner-steps span {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.35;
}

.partner-form .field {
  margin-bottom: 14px;
}

.partner-form .field > span {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.partner-form input,
.partner-form textarea,
.partner-reply input,
.partner-approve input,
.partner-approve select,
.admin-filters input,
.admin-filters select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.partner-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.partner-form input:focus,
.partner-form textarea:focus,
.partner-reply input:focus {
  outline: none;
  border-color: var(--red);
}

.partner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.partner-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}

.partner-card.open {
  border-color: var(--line-strong);
}

.partner-card.unread .partner-head b::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--red-bright);
  vertical-align: middle;
}

.partner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.partner-head b {
  display: block;
  font-size: 13.5px;
}

.partner-head span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.partner-chip {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  background: var(--panel-3);
}

.partner-chip.approved {
  color: var(--green-bright);
  border-color: rgba(53, 201, 127, 0.4);
}

.partner-chip.talking {
  color: var(--gold-soft);
  border-color: rgba(201, 169, 97, 0.4);
}

.partner-chip.rejected,
.partner-chip.closed {
  color: var(--text-mute);
}

.partner-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partner-quote {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--panel-3);
  white-space: pre-wrap;
}

.partner-table {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(53, 201, 127, 0.3);
  background: rgba(31, 163, 99, 0.08);
}

.partner-table b {
  font-size: 13.5px;
}

.partner-table span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.partner-table-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.partner-table i {
  flex-basis: 100%;
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
}

.partner-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.partner-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--panel-3);
  border: 1px solid var(--line);
}

.partner-msg.mine {
  align-self: flex-end;
  background: rgba(200, 16, 46, 0.14);
  border-color: rgba(232, 48, 74, 0.3);
}

.partner-msg span {
  font-size: 10.5px;
  color: var(--text-mute);
}

.partner-msg p {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.partner-reply {
  display: flex;
  gap: 8px;
}

.partner-reply .btn {
  flex: none;
  padding: 0 14px;
}

.partner-payouts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.partner-payouts > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--panel-2);
}

.partner-payouts b {
  color: var(--green-bright);
  font-size: 13.5px;
}

.partner-payouts span {
  font-size: 12px;
  color: var(--text-dim);
}

.partner-payouts i {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-mute);
}

/* --- вкладки админки, партнёры и игроки --- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 -2px;
}

.admin-tabs button {
  position: relative;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.admin-tabs button.on {
  color: var(--text);
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(224, 32, 62, 0.18), rgba(224, 32, 62, 0.06));
}

.admin-tabs .dot {
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-style: normal;
  font-size: 10.5px;
}

.watch-row.unread b::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--red-bright);
  vertical-align: middle;
}

.partner-approve {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-2);
}

.approve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.approve-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.approve-check {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.approve-check input {
  width: auto !important;
}

.partner-actions {
  display: flex;
  gap: 8px;
}

.admin-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-filters input {
  width: 200px;
}

.admin-filters select {
  width: auto;
}

.players-table {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
}

.players-table tr[data-player] {
  cursor: pointer;
}

.players-table tr[data-player]:hover td {
  background: var(--panel-3);
}

.players-table td i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--text-mute);
}

.players-table td.plus {
  color: var(--green-bright);
}

.players-table td.minus {
  color: var(--red-bright);
}

.player-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
}

.player-card .watch-head .btn {
  margin-left: auto;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.player-stats > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-3);
}

.player-stats b {
  display: block;
  font-size: 14.5px;
}

.player-stats span {
  font-size: 11px;
  color: var(--text-mute);
}

@media (max-width: 980px) {
  .partner-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- картинки сайта в админке --- */
.image-group {
  margin-top: 18px;
}

.image-group h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.image-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.image-slot.custom {
  border-color: rgba(53, 201, 127, 0.4);
}

.image-preview {
  height: 104px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-deep) repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  display: grid;
  place-items: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-slot figcaption {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.35;
}

.image-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  flex-wrap: wrap;
}

.image-actions .btn {
  flex: 1;
  min-width: 96px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

/* выбор языка в настройках */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.lang-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.lang-grid button b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--panel-3);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.lang-grid button span {
  font-size: 13px;
}

.lang-grid button.on {
  border-color: var(--red);
  color: var(--text);
  background: linear-gradient(180deg, rgba(224, 32, 62, 0.16), rgba(224, 32, 62, 0.04));
}

.lang-grid button.on b {
  background: var(--red);
  color: #fff;
}

/* требование отыгрыша перед выводом */
.wager-note {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 97, 0.35);
  background: rgba(201, 169, 97, 0.08);
  color: var(--gold-soft);
}

.wager-note b {
  display: block;
  font-size: 13px;
}

.wager-note span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

.wager-note svg {
  flex: none;
  margin-top: 2px;
}


/* ---- расклад китайского покера в админке ---- */

.cp-admin-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.cp-admin-player {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.cp-admin-player.acting {
  border-color: rgba(60, 224, 127, 0.5);
}

.cp-admin-player header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 2px;
}

.cp-admin-player header b {
  font-size: 13px;
}

.cp-admin-player header span {
  font-size: 11.5px;
  color: var(--text-mute);
}

.cp-admin-row,
.cp-admin-hand {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-mute);
}

.cp-admin-row > span,
.cp-admin-hand > span {
  min-width: 64px;
}

.cp-admin-hand {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.cp-admin-row.drop {
  opacity: 0.75;
}

.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.flag-chip:hover {
  border-color: var(--red);
  color: var(--text);
  background: rgba(211, 47, 47, 0.1);
}

.flag-chip svg {
  opacity: 0.65;
}

.country-picker .control {
  margin-bottom: 12px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.country-option[hidden] {
  display: none;
}

.country-option:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.country-option.on {
  border-color: var(--red);
  background: rgba(211, 47, 47, 0.12);
}

.country-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* каждая валюта в кассе со своим фирменным цветом */
.chip-row button.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip-row button.coin-chip > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 22%, transparent);
  flex: none;
}

.chip-row button.coin-chip:hover {
  border-color: color-mix(in srgb, var(--coin) 55%, var(--line));
  color: var(--text);
}

.chip-row button.coin-chip.on {
  background: color-mix(in srgb, var(--coin) 16%, transparent);
  border-color: color-mix(in srgb, var(--coin) 70%, transparent);
  color: color-mix(in srgb, var(--coin) 75%, #ffffff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--coin) 25%, transparent) inset;
}

.chip-row button.coin-chip.on > i {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 32%, transparent), 0 0 10px var(--coin);
}

.coin-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--coin) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--coin) 35%, transparent);
  color: color-mix(in srgb, var(--coin) 78%, #ffffff);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  vertical-align: middle;
}

.coin-tag > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coin);
  flex: none;
}

:root[data-theme="light"] body:not(.game) .chip-row button.coin-chip.on,
:root[data-theme="light"] body:not(.game) .coin-tag {
  color: color-mix(in srgb, var(--coin) 72%, #000000);
}

/* ------------------------------------------------------------------ *
 * Реферальная программа: страница игрока и таблица в админке
 * ------------------------------------------------------------------ */
.ref-intro p {
  margin: 10px 0 0;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 760px;
}

.ref-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.ref-steps > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.ref-steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(150deg, #ffe9b0, var(--gold));
  color: #17181f;
  font-size: 14px;
}

.ref-steps span {
  color: var(--text-dim);
  font-size: 13.5px;
}

.ref-copy {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.ref-copy input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.ref-share {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ref-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.ref-stats > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-stats span {
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.ref-stats b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -18px -18px;
  padding: 0 18px 18px;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .good {
  color: var(--green, #35c46a);
}

.data-table .muted,
p.muted {
  color: var(--text-dim);
}

.ref-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-player img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.ref-player div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ref-player span {
  color: var(--text-dim);
  font-size: 12px;
}

@media (max-width: 900px) {
  .ref-steps,
  .ref-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (pointer: coarse), (max-width: 900px) {
  .st-pct-box {
    height: 44px;
  }

  .st-pct-input {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .ref-steps {
    grid-template-columns: 1fr;
  }

  .ref-copy {
    flex-direction: column;
  }
}

/* ------------------------------------------------------------------ *
 * Админка: карточки акций и таблица наград
 * ------------------------------------------------------------------ */

.admin-head .muted {
  margin-right: auto;
  margin-left: 12px;
  font-size: 12.5px;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}

.admin-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.admin-card-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.admin-card-foot .btn,
.admin-head .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.admin-field input,
.admin-field select,
.admin-stones input,
.admin-stones select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.admin-stones input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.admin-stones td {
  padding: 8px 10px;
}

.admin-stones .btn {
  height: 32px;
  padding: 0 10px;
}

/* ------------------------------------------------------------------ *
 * Касса: выбор монеты и сети
 * ------------------------------------------------------------------ */

.coin-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  max-width: 280px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-mute);
}

.coin-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.coin-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.coin-filters::-webkit-scrollbar {
  height: 0;
}

.coin-filters button {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.14s, border-color 0.14s;
}

.coin-filters button:hover {
  color: var(--text);
}

.coin-filters button.on {
  background: rgba(226, 56, 79, 0.16);
  border-color: var(--red);
  color: #ff9aa8;
}

.coin-grid {
  display: grid;
  /* сетка, а не колонка: у шлюза монет десятки, и списком их не окинуть взглядом */
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  /* примерно четыре ряда, дальше прокрутка с подсказкой снизу, что список длиннее */
  max-height: 306px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent);
}

.coin-grid:not(:hover) {
  scrollbar-width: none;
}

.coin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
  text-align: left;
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
}

.coin-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--coin) 55%, var(--line));
}

.coin-card.on {
  background: color-mix(in srgb, var(--coin) 14%, transparent);
  border-color: color-mix(in srgb, var(--coin) 70%, transparent);
}

.coin-card .coin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 22%, transparent);
}

.coin-card b {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.coin-card span {
  font-size: 11.5px;
  color: var(--text-mute);
}

.coin-card .coin-off {
  position: absolute;
  top: 8px;
  right: 8px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.coin-nets {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coin-nets > span {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.coin-chip em {
  font-style: normal;
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-mute);
}

@media (max-width: 620px) {
  .coin-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    max-height: 244px;
  }

  .coin-search {
    max-width: none;
  }
}

/* ------------------------------------------------------------------ *
 * Админка: вкладка «Симуляция»
 * ------------------------------------------------------------------ */

.sim-subtabs {
  margin: 0 0 14px;
  align-items: center;
}

@media (max-width: 640px) {
  .sim-versions-head {
    flex-wrap: wrap;
  }

  .sim-versions-head > .muted {
    flex: 1 1 100%;
    order: 2;
    overflow-wrap: anywhere;
  }
}

.sim-running {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--gold-soft);
  font-size: 12.5px;
}

.sim-bots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 13px;
}

.sim-bots-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.sim-bots-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
}

.sim-bots-state.on i {
  background: var(--green-bright);
}

.sim-bots-state.off i {
  background: var(--red-bright);
}

.sim-bots-state.on,
.sim-bots-state.off {
  color: var(--text);
}

.sim-bots-online {
  color: var(--text-dim);
}

.sim-bots-online b {
  color: var(--text);
}

.sim-bots-stale {
  color: var(--gold-soft);
  font-size: 12px;
}

.sim-bots .btn {
  height: 32px;
  margin-left: auto;
  padding: 0 12px;
  font-size: 12.5px;
}

.sim-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.sim-toolbar .btn,
.sim-actions .btn {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sim-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sim-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.sim-card header {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.sim-card-wide {
  grid-column: span 2;
}

.sim-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-stat span {
  font-size: 12px;
  color: var(--text-dim);
}

.sim-stat b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.sim-stat i {
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
}

.admin-panel .pos,
.data-table .pos {
  color: var(--green-bright);
}

.admin-panel .neg,
.data-table .neg {
  color: var(--red-bright);
}

.sim-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sim-badge.on,
.sim-badge.done {
  border-color: var(--green);
  color: var(--green-bright);
}

.sim-badge.running,
.sim-badge.queued {
  border-color: var(--gold-deep);
  color: var(--gold-soft);
}

.sim-badge.failed,
.sim-badge.interrupted {
  border-color: var(--red);
  color: var(--red-bright);
}

.sim-active-row td {
  background: rgba(31, 163, 99, 0.06);
}

.admin-panel h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-size: 13.5px;
}

.sim-inline {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}

.sim-note {
  margin: 0 0 6px;
  font-size: 12.5px;
}

.sim-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}

.sim-group select,
.sim-params select,
#sim-version-variant {
  color-scheme: dark;
}

.sim-group select option,
.sim-params select option,
#sim-version-variant option {
  background-color: var(--panel-2);
  color: var(--text);
}

:root[data-theme="light"] .sim-group select,
:root[data-theme="light"] .sim-params select,
:root[data-theme="light"] #sim-version-variant {
  color-scheme: light;
}

.sim-group .sim-wide,
.sim-params .sim-wide {
  grid-column: span 2;
}

.sim-group .sim-del {
  height: 38px;
  justify-self: end;
}

.sim-group .sim-xray-check {
  grid-column: span 2;
  min-height: 38px;
  font-size: 12.5px;
}

/* X-ray-прогоны нечестные: метка должна бросаться в глаза и не путаться со статусами */
.sim-badge.xray {
  border-color: #8e5cf0;
  color: #c3a4ff;
}

.sim-xray-warn {
  margin: 8px 0 12px;
  padding: 9px 12px;
  border: 1px solid #8e5cf0;
  border-radius: 8px;
  background: rgba(142, 92, 240, 0.1);
  color: #d9c6ff;
  font-size: 13px;
}

:root[data-theme="light"] .sim-badge.xray,
:root[data-theme="light"] .sim-xray-warn {
  color: #5a32b8;
}

.sim-params {
  margin-top: 12px;
}

.sim-check {
  margin: 12px 0 4px;
  gap: 10px;
}

.sim-field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
}

.sim-field-label label {
  min-width: 0;
}

.sim-help-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-help-check .checkbox {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.sim-check-text {
  min-width: 0;
}

.sim-help {
  display: inline-flex;
  flex: none;
}

.sim-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-dim);
  font: 600 13px/1 Georgia, serif;
  cursor: pointer;
  flex: none;
}

.sim-help-button:hover,
.sim-help-button[aria-expanded="true"] {
  background: var(--panel);
  color: var(--text);
  border-color: var(--text-mute);
}

.sim-help-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.sim-help .sim-help-tip {
  position: fixed;
  z-index: 250;
  box-sizing: border-box;
  width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  overflow: auto;
  overflow-wrap: anywhere;
  user-select: text;
}

.sim-help-tip[hidden] {
  display: none;
}

.sim-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sim-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green-deep), var(--green-bright));
  transition: width 0.6s ease;
}

.sim-progress.on i {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
}

.sim-spark {
  width: 100%;
  height: 120px;
  display: block;
}

.sim-spark.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 12.5px;
}

.sim-spark .zero {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
}

.sim-spark .line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.sim-spark .s0 {
  stroke: var(--green-bright);
}

.sim-spark .s1 {
  stroke: var(--gold-soft);
}

.sim-spark-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-mute);
}

.sim-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.sim-jobs button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sim-jobs button.on {
  border-color: var(--red);
}

.sim-error {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgba(200, 16, 46, 0.08);
  color: var(--red-bright);
  font-size: 12px;
  white-space: pre-wrap;
}

.sim-params-cell {
  max-width: 520px;
  font-size: 11.5px;
  color: var(--text-dim);
  word-break: break-word;
}

.sim-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-modal-text {
  color: var(--text-dim);
  line-height: 1.6;
}

.sim-radio {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 10px 0;
  line-height: 1.4;
  cursor: pointer;
}

.sim-radio .muted {
  color: var(--text-dim);
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .sim-card-wide,
  .sim-group .sim-wide,
  .sim-params .sim-wide {
    grid-column: auto;
  }

  .sim-group .sim-xray-check {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------------ *
 * Админка: вкладка «Статистика»
 * ------------------------------------------------------------------ */

.st-head {
  flex-wrap: wrap;
  gap: 10px;
}

.st-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.st-controls .btn {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}

.st-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.st-hero > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.st-hero span {
  font-size: 11.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-mute);
}

.st-hero b {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.st-hero > div:first-child b {
  font-size: 30px;
}

.st-hero i {
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
}

.st-hero .pos,
.st-card .pos {
  color: var(--green-bright);
}

.st-hero .neg,
.st-card .neg {
  color: var(--red-bright);
}

.st-big {
  font-size: 26px !important;
}

.st-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 4px 0 0;
  font-size: 12.5px;
}

.st-facts dt {
  color: var(--text-dim);
}

.st-facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.st-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.st-chart {
  display: block;
  width: 100%;
  height: 180px;
}

.st-chart .zero {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.st-bar {
  fill: var(--green-bright);
  opacity: 0.85;
}

.st-bar.neg {
  fill: var(--red-bright);
}

.st-bar.bf {
  fill: var(--gold-soft);
}

.st-bar:hover {
  opacity: 1;
}

.st-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-mute);
}

.st-table thead th,
.st-table tbody td {
  padding: 10px 12px;
  white-space: nowrap;
}

.st-table td.num,
.st-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.st-table .muted {
  color: var(--text-dim);
}

.st-table tr.st-total td {
  border-top: 1px solid var(--line-strong);
  font-weight: 700;
}

.st-table tr.st-split td {
  border-top: 1px solid var(--line-strong);
}

.st-table tr.st-sub td {
  font-size: 12.5px;
  color: var(--text-dim);
}

.st-table tr.st-sub td:first-child {
  padding-left: 26px;
}

.st-error {
  color: var(--red-bright) !important;
}

@media (max-width: 720px) {
  .st-hero b {
    font-size: 20px;
  }

  .st-hero > div:first-child b {
    font-size: 24px;
  }
}

.table-wrap.st-wrap {
  margin: 0 0 10px;
  padding: 0 0 4px;
}

/* --- настройки ботов: одна карточка из двух частей — общие настройки и плитки вариантов --- */

.st-set {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

/* две соседние части читаются одной карточкой: общая часть даёт разделитель снизу */
.st-set-general {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.st-set-variants {
  margin-bottom: 14px;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.st-set fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.st-set-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 12px 14px 0;
}

.st-set .st-set-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.st-set-sub {
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.st-set-body {
  padding: 12px 14px 14px;
}

.st-set .empty {
  padding: 20px 14px;
  color: var(--text-dim);
}

.st-set .st-set-status {
  margin: 10px 0 0;
}

.st-set-notes {
  display: grid;
  gap: 3px;
  margin: 12px 0 0;
  padding: 10px 0 0 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-dim);
}

.st-set-notes li::marker {
  color: var(--text-mute);
}

/* общая строка: smode · процент · сохранить */
.st-set-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.st-gen-smode {
  color: var(--text);
}

.st-gen-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}

.st-gen-text b {
  font-size: 13.5px;
  font-weight: 600;
}

.st-gen-text small {
  font-size: 12px;
  color: var(--text-dim);
}

.st-pct {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
}

.st-pct-box {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.st-pct-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.2);
}

.st-pct-box:has(.st-pct-input:user-invalid) {
  border-color: var(--red-bright);
}

.st-pct-input {
  width: 76px;
  height: 100%;
  padding: 0 4px 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.st-pct-suffix {
  font-size: 13px;
  color: var(--text-dim);
}

.st-save {
  height: 36px;
  margin-left: auto;
  padding: 0 20px;
}

/* плитки вариантов */
.st-vgroups {
  display: grid;
  gap: 14px;
}

.st-vgroup legend {
  float: left;
  width: 100%;
  padding: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.st-vgroup legend + * {
  clear: both;
}

/* не больше трёх колонок, не уже 240px; колонки одинаковые в обеих группах */
.st-vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(240px, (100% - 22px) / 3)), 1fr));
  gap: 10px;
}

.st-vtile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 8px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: border-color 0.15s, background-color 0.15s;
}

.st-vtile:hover {
  border-color: var(--line-strong);
}

.st-vtile.is-on {
  border-color: rgba(201, 169, 97, 0.45);
  border-color: color-mix(in srgb, var(--gold) 50%, transparent);
  background: rgba(201, 169, 97, 0.06);
  background: color-mix(in srgb, var(--gold) 7%, var(--panel-2));
}

/* padding, а не min-height: на тач-экранах base.css сам поднимает .checkbox до 44px */
.st-vtile-check {
  display: flex;
  width: 100%;
  padding: 7px 0;
  color: var(--text-dim);
}

.st-vtile.is-on .st-vtile-check {
  color: var(--text);
}

.st-vtile-name {
  min-width: 0;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.st-vtile-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  min-height: 32px;
}

.st-vbadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.st-vbadge-own {
  border-style: solid;
  border-color: var(--gold-deep);
  color: var(--gold-soft);
}

.st-vbadge-own::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.st-vreset {
  height: 32px;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 0;
}

/* занятая форма: блокировка видна на самих контролах, без мигания всей плитки */
.st-set fieldset:disabled .checkbox,
.st-set fieldset:disabled .checkbox input {
  cursor: not-allowed;
}

.st-set fieldset:disabled .checkbox input,
.st-set fieldset:disabled .st-pct-box {
  opacity: 0.5;
}

.st-set .checkbox input:focus-visible,
.st-set .btn:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

/* светлая тема: gold-soft на плитке и red-bright на карточке не дотягивают до 4.5:1 */
:root[data-theme="light"] body:not(.game) .st-vbadge-own {
  color: var(--text);
}

:root[data-theme="light"] body:not(.game) .st-set .st-error {
  color: var(--red) !important;
}

@media (max-width: 560px) {
  .st-set-head {
    padding: 12px 12px 0;
  }

  .st-set-body {
    padding: 10px 12px 12px;
  }

  .st-set-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .st-pct {
    justify-content: space-between;
  }

  .st-save {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-vtile,
  .st-pct-box {
    transition: none;
  }

  .st-set .btn:active {
    transform: none;
  }
}

/* страница «Приложение»: шапка с кнопкой, плитки преимуществ и вкладки с шагами */
.app-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 26px;
}

.app-hero img {
  border-radius: 14px;
  flex: none;
}

.app-hero-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.app-hero-body h2 {
  font-size: 21px;
  font-weight: 800;
}

.app-hero-body p {
  color: var(--muted);
  font-size: 14px;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.btn.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.app-meta {
  color: var(--muted);
  font-size: 13px;
}

.app-section {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.app-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}

.app-section-head .app-section {
  margin: 0;
}

.app-benefits .info-card .ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.app-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-tabs {
  flex-wrap: wrap;
}

.app-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.app-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.app-note svg {
  flex: none;
  margin-top: 2px;
}

.app-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.5;
}

.app-list li::marker {
  color: var(--gold, #e8b64c);
  font-weight: 700;
}

.app-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 16px;
}

@media (max-width: 720px) {
  .app-hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .app-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
/* Persistent live bot management. */
.bots-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.bots-filters { display: flex; gap: 10px; }
.bots-panel p { line-height: 1.6; }
.bots-table-wrap { overflow-x: auto; }
.bots-table { width: 100%; border-collapse: collapse; }
.bots-table th, .bots-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border, #27272b); vertical-align: top; }
.bots-table small { display: block; color: var(--muted, #96969d); margin-top: 5px; }
.bots-table form { display: flex; gap: 6px; margin: 5px 0; }
.bots-table input { width: 110px; }
.bots-panel input, .bots-panel select { padding: 8px 10px; border: 1px solid var(--border, #27272b); border-radius: 6px; color: inherit; background: var(--panel, #141417); }
.bots-error { color: #ff6578; }
.bots-registry-controls, .bots-pagination, .bots-page-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bots-registry-controls { margin: 16px 0; }
.bots-registry-controls label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bots-pagination { justify-content: space-between; margin: 16px 0; }
.bots-page-buttons span { white-space: nowrap; }
.bots-pagination button:disabled { opacity: .45; cursor: default; }
.bots-sort-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bots-sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.bots-sort-button span { color: var(--muted, #96969d); }
.bots-sort-button.is-active span { color: var(--accent, #d2b06c); }
.bots-sort-button:hover { text-decoration: underline; }
.bots-sort-button:disabled { opacity: .45; cursor: default; }
.bots-registry-controls :focus-visible, .bots-pagination :focus-visible, .bots-sort-button:focus-visible { outline: 2px solid var(--accent, #d2b06c); outline-offset: 3px; }

/* Admin watch workflow: specs/admin-table-watch/spec.md.
   Scope these rules so shared support/partner watch classes retain their layout. */
.watch-panel {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.watch-panel .admin-head {
  flex-wrap: wrap;
  gap: 12px;
}

.watch-panel .admin-head > b {
  font-size: 16px;
  font-weight: 600;
}

.watch-panel .watch-update,
.watch-panel .watch-row i,
.watch-panel .watch-seats th,
.watch-panel .watch-seats i,
.watch-panel .empty-note {
  color: var(--text-dim);
}

.watch-panel .watch-update { font-size: 13px; }

.watch-filters { display: grid; gap: 8px; margin-bottom: 12px; }
.watch-filter-group { display: flex; flex-wrap: wrap; gap: 8px; }

.watch-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.watch-filter > span { color: var(--text-dim); }
.watch-filter:hover, .watch-panel .watch-pick:hover { background: var(--panel-3); }
.watch-filter[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

.watch-results { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-dim); font-size: 13px; }
.watch-panel .btn { min-height: 40px; height: auto; font-size: 13px; white-space: normal; }

.watch-panel summary {
  color: var(--text-dim);
  cursor: pointer;
  min-height: 40px;
  padding: 10px 0;
  font-size: 13px;
  line-height: 1.45;
}

.watch-help { margin: 0 0 16px; border-block: 1px solid var(--line); }
.watch-help p { color: var(--text-dim); font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.watch-panel .watch-grid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; }
.watch-panel .watch-list { max-height: clamp(360px, 62vh, 720px); gap: 8px; padding: 4px; scroll-behavior: auto; }
.watch-panel .watch-row { padding: 12px; gap: 8px; min-width: 0; border-radius: var(--radius-sm); }
.watch-panel .watch-row.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--red); }
.watch-panel .watch-pick { position: relative; gap: 4px; min-height: 40px; border-radius: 4px; }
.watch-panel .watch-pick b { font-size: 14px; font-weight: 600; }
.watch-panel .watch-row span { font-size: 13px; line-height: 1.45; }
.watch-panel .watch-selected { color: var(--text); font-weight: 600; }
.watch-effective { color: var(--text-dim); font-size: 13px; }
.watch-panel .watch-live { margin: 0; padding: 8px 12px; }
.watch-settings { border-top: 1px solid var(--line); }
.watch-panel .watch-bots { margin: 0 0 12px; gap: 8px; }
.watch-panel .watch-bots p { font-size: 13px; color: var(--text-dim); }
.watch-panel .watch-bot { flex-wrap: wrap; }
.watch-panel .watch-bot > span:first-child { min-width: 0; flex: 1; }
.watch-panel .watch-xray { color: var(--text); font-size: 12px; }
.watch-panel .watch-xray.on { border-color: var(--red); }
.watch-panel .watch-xray.off { border-color: var(--green-bright); }
.watch-panel .watch-xray.unknown { border-color: var(--text-dim); }
.watch-panel .watch-smode { gap: 8px; padding: 0; font-size: 13px; }
.watch-panel .watch-smode select.control { min-height: 40px; color: var(--text); }
.watch-panel .watch-smode .btn { padding: 8px 12px; }
.watch-save-error { flex-basis: 100%; margin: 0; color: var(--text); border-left: 3px solid var(--red); padding-left: 8px; }
.watch-detail { min-width: 0; }
.watch-detail-title { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.watch-detail-title > span { color: var(--text-dim); font-size: 13px; }
.watch-panel .watch-view { max-height: clamp(360px, 62vh, 720px); overflow: auto; padding: 4px; }
.watch-panel .watch-view .watch-head > b { display: none; }
.watch-panel .watch-seats { min-width: 580px; }
.watch-hidden { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 3px solid var(--red); color: var(--text); font-size: 13px; }
.watch-announcement { color: var(--text-dim); font-size: 13px; margin: 12px 0 0; }
.watch-announcement:empty { display: none; }
.watch-panel :is(button, a, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.watch-panel .empty-note .btn { display: block; margin-top: 12px; }
.watch-panel .cp-admin-player { min-width: 0; }
.watch-panel .cp-admin-player header { flex-wrap: wrap; }
.watch-panel .cp-admin-row, .watch-panel .cp-admin-hand { flex-wrap: wrap; }
.watch-panel .cp-admin-row,
.watch-panel .cp-admin-hand,
.watch-panel .cp-admin-player header span { color: var(--text-dim); }
.watch-panel .cp-admin-player header .watch-xray { color: var(--text); }
.watch-panel .cp-admin-row.drop { opacity: 1; }

@media (max-width: 860px) {
  .watch-panel .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .watch-panel .watch-list { max-height: 280px; }
  .watch-panel .watch-view { max-height: 62vh; }
  .watch-panel :is(.btn, .watch-filter, .watch-pick, summary, select.control) { min-height: 44px; }
}

/* The existing chrome exceeds 320px by a few pixels; constrain only this page. */
@media (max-width: 360px) {
  .admin-page .topbar { gap: 6px; }
}
