/* Global Network — player stats, public player page and admin panel (see stats.js) */

:root {
  /* Good / average / weak cells (muted so white text stays readable; the number is always shown) */
  --good-bg: rgba(52, 168, 83, 0.32);
  --mid-bg: rgba(214, 168, 46, 0.3);
  --bad-bg: rgba(214, 64, 52, 0.32);
  --good-fg: #7fe09a;
  --mid-fg: #f1cf6b;
  --bad-fg: #ff8f84;
  --panel: rgba(255, 255, 255, 0.035);
}

/* Stats tables need more room than the profile form */
.profile-page {
  max-width: 980px;
}

.profile-page .profile-form {
  max-width: 720px;
}

.admin-page [hidden],
.player-page [hidden] {
  display: none !important;
}

/* ---------- Tabs: STATISTIC / LAST MATCH / NEWS ---------- */

.pstats {
  margin-top: 28px;
}

.pstats-seg {
  max-width: 520px;
}

.pstats-body {
  margin-top: 18px;
}

.st-block {
  margin-top: 26px;
}

.st-block:first-child {
  margin-top: 0;
}

.st-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.st-block-head .st-h {
  margin: 0;
}

.st-h {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Colour tones */
.c-good, .st-tile.c-good, .lm-stat.c-good { background: var(--good-bg); }
.c-mid,  .st-tile.c-mid,  .lm-stat.c-mid  { background: var(--mid-bg); }
.c-bad,  .st-tile.c-bad,  .lm-stat.c-bad  { background: var(--bad-bg); }
.c-good-text { color: var(--good-fg); }
.c-mid-text  { color: var(--mid-fg); }
.c-bad-text  { color: var(--bad-fg); }

/* ---------- Awards (logos in one line) ---------- */

.aw-row {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 2px 2px 6px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
}

.aw-item {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.aw-item .ev-logo {
  border-radius: 10px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

/* ---------- Overview tiles ---------- */

.st-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.st-tile {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--panel);
  font-variant-numeric: tabular-nums;
}

.st-tile--hero {
  grid-column: 1 / -1;
  min-height: 54px;
}

.st-tile-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
}

.st-tile-value {
  font-size: 16px;
  font-weight: 800;
}

.st-tile--hero .st-tile-value {
  font-size: 20px;
}

.st-tile.c-good, .st-tile.c-mid, .st-tile.c-bad {
  border-color: transparent;
}

/* ---------- Chips (filters) ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.chip-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.chip-btn.is-active {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.chip-btn:focus-visible,
.th-sort:focus-visible,
.admin-tab:focus-visible,
.ad-count:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- Tables ---------- */

.st-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}

.st-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.st-table th,
.st-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.st-table tbody tr:last-child > * {
  border-bottom: 0;
}

.st-table thead th {
  position: sticky;
  top: 0;
  background: #141417;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.st-table tbody th {
  font-weight: 600;
  text-align: left;
}

.st-table tbody tr:hover > * {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.03);
}

/* First column stays visible while scrolling sideways */
.st-table tbody th[scope="row"],
.st-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #121215;
}

.st-table thead th:first-child {
  z-index: 2;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.th-sort:hover,
.th-sort.is-sorted {
  color: var(--text);
}

.th-arrow {
  font-size: 8px;
}

.td-empty {
  margin: 0;
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
  white-space: normal;
}

.td-date {
  color: var(--text-muted);
}

.td-team {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.map-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: linear-gradient(90deg, hsla(var(--h), 45%, 45%, 0.35), hsla(var(--h), 45%, 45%, 0.08));
  font-weight: 700;
}

/* Map with its picture */
.map-chip--img {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
}

.map-chip--img img {
  width: 30px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Map screenshot behind the map cell (fades into the table on the right) */
.st-table tbody th.td-map.has-bg {
  min-width: 110px;
  background:
    linear-gradient(90deg, rgba(18, 18, 21, 0.25), rgba(18, 18, 21, 0.55) 55%, #121215 100%),
    var(--bg) center / cover no-repeat,
    #121215;
}

.td-map.has-bg .map-chip--img {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Last match: map screenshot as the card background */
.lm-card.has-bg {
  background:
    linear-gradient(180deg, rgba(12, 12, 15, 0.55) 0%, rgba(12, 12, 15, 0.82) 45%, rgba(12, 12, 15, 0.96) 70%),
    var(--bg) center top / cover no-repeat,
    #121215;
}

.lm-card.has-bg .lm-kicker,
.lm-card.has-bg .lm-sub,
.lm-card.has-bg .lm-outcome {
  color: rgba(255, 255, 255, 0.78);
}

.lm-card.has-bg .lm-event,
.lm-card.has-bg .lm-team,
.lm-card.has-bg .lm-nums {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.lm-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: -4px 0 16px;
}

.lm-map-img {
  width: 90px;
  height: 105px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.lm-map-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.td-event {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.td-event > span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.ev-name {
  font-weight: 700;
}

.ev-tier {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
}

.ev-logo {
  flex-shrink: 0;
  width: var(--s, 28px);
  height: var(--s, 28px);
  border-radius: 8px;
  object-fit: contain;
}

.ev-logo--text {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  font-size: calc(var(--s, 28px) * 0.36);
  font-weight: 800;
}

.place {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  font-weight: 800;
}

.place--1 { background: rgba(212, 175, 55, 0.4); color: #ffe9a3; }
.place--2 { background: rgba(192, 192, 200, 0.32); color: #f1f1f5; }
.place--3 { background: rgba(176, 110, 54, 0.42); color: #ffd1a6; }

.award,
.mvp-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.mvp-badge--sm {
  padding: 2px 6px;
  font-size: 10px;
}

.score {
  font-weight: 800;
}

.score--win { color: var(--good-fg); }
.score--loss { color: var(--bad-fg); }

/* ---------- Player stability ---------- */

.st-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.st-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.st-card-label {
  color: var(--text-muted);
  font-size: 12px;
}

.st-card-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.st-card-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.st-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

/* Two-handle date range */
.st-range {
  margin-bottom: 10px;
}

.st-range-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.st-range-labels b {
  color: var(--text);
}

.st-range-track {
  position: relative;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent var(--a), rgba(255, 255, 255, 0.55) var(--a), rgba(255, 255, 255, 0.55) var(--b), transparent var(--b))
      center / calc(100% - 28px) 4px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)) center / calc(100% - 28px) 4px no-repeat,
    var(--panel);
}

.st-range-track input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 4px;
  background: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

.st-range-track input::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid #0b0b0d;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: auto;
  cursor: grab;
  -webkit-appearance: none;
}

.st-range-track input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #0b0b0d;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: auto;
  cursor: grab;
}

.st-range-track input::-moz-range-track {
  background: none;
}

.st-range-track input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

/* Chart */
.st-chart {
  position: relative;
  padding: 10px 6px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}

.ch-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.ch-ref {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ch-ylab,
.ch-xlab {
  fill: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ch-ylab {
  text-anchor: end;
}

.ch-xlab {
  text-anchor: middle;
}

.ch-area {
  fill: url(#st-area);
}

.ch-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ch-dot {
  fill: #fff;
  stroke: #0e0e11;
  stroke-width: 2;
  transition: r 0.15s ease;
}

.ch-dot.is-on {
  r: 6;
}

.ch-cross {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
}

.ch-hit {
  fill: transparent;
  cursor: crosshair;
}

.ch-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 170px;
  max-width: 240px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 16, 19, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
}

.ch-tip-ev {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.ch-tip-date {
  color: var(--text-muted);
}

/* ---------- Last match ---------- */

.lm-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.09), transparent 60%),
    var(--panel);
}

.lm-card--win { border-color: rgba(127, 224, 154, 0.35); }
.lm-card--loss { border-color: rgba(255, 143, 132, 0.32); }

.lm-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lm-head-text {
  flex: 1;
  min-width: 0;
}

.lm-kicker,
.lm-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.lm-event {
  margin: 2px 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.lm-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.lm-team {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lm-team--opp {
  text-align: left;
}

.lm-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lm-nums {
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.lm-card--win .lm-nums b:first-child { color: var(--good-fg); }
.lm-card--loss .lm-nums b:last-child { color: var(--bad-fg); }

.lm-outcome {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.lm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  font-variant-numeric: tabular-nums;
}

.lm-stat.c-good, .lm-stat.c-mid, .lm-stat.c-bad {
  border-color: transparent;
}

.lm-stat span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
}

.lm-stat b {
  font-size: 17px;
}

/* ---------- News ---------- */

.news-list {
  display: grid;
  gap: 10px;
}

.news-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.news-date {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.news-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.news-body {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.news-tag {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

a.news-tag:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

/* ---------- Empty / loading ---------- */

.st-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
}

.st-empty-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.st-empty-hint {
  margin: 0;
  max-width: 380px;
  font-size: 14px;
}

.st-skeleton {
  display: grid;
  gap: 8px;
}

.st-skeleton span {
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: st-shimmer 1.2s linear infinite;
}

.st-skeleton span:nth-child(2) { height: 140px; }

@keyframes st-shimmer {
  to { background-position: -200% 0; }
}

/* ---------- Header admin button ---------- */

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.admin-btn[hidden] {
  display: none;
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .admin-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .admin-btn-text {
    display: none;
  }
}

@media (max-width: 760px) {
  .admin-btn {
    width: 32px;
    height: 32px;
  }
}

/* ---------- Admin panel ---------- */

.admin-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.admin-head .rules-title {
  margin-bottom: 4px;
}

.admin-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.is-active {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.ad-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.ad-counts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.ad-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ad-count:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.ad-count-n {
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ad-count-l {
  color: var(--text-muted);
  font-size: 12.5px;
}

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

.ad-steps {
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  line-height: 1.7;
}

/* Forms */
.aform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.afield {
  display: block;
  min-width: 0;
  margin-bottom: 12px;
}

.aform-grid .afield {
  margin-bottom: 0;
}

.afield--wide {
  grid-column: span 2;
}

.afield > span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.afield input:not([type="file"]),
.afield select,
.afield textarea,
.ad-filters select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  color-scheme: dark;
}

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

.afield select option,
.ad-filters select option {
  background: #141416;
}

.afield input:focus,
.afield select:focus,
.afield textarea:focus,
.ad-filters select:focus {
  outline: none;
  border-color: var(--text);
}

.afield input[type="file"] {
  min-width: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
}

.afield input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ad-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acheck {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.acheck input {
  width: 20px;
  height: 20px;
  accent-color: #fff;
}

.aform .field-hint {
  margin: 0 0 12px;
}

.aform .auth-error {
  margin-top: 4px;
}

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

.ad-filters select {
  width: auto;
  min-width: 170px;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13px;
}

/* Lists */
.ad-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ad-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.ad-item-main {
  flex: 1;
  min-width: 0;
}

.ad-item-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.ad-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.ad-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ad-news {
  display: grid;
  gap: 8px;
}

.ad-news .ad-item-actions {
  justify-content: flex-end;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.pill--live { border-color: rgba(127, 224, 154, 0.5); color: var(--good-fg); }
.pill--finished { color: var(--text-muted); }
.pill--upcoming { border-color: rgba(241, 207, 107, 0.45); color: var(--mid-fg); }

.tour-btn.ad-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 11.5px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tour-btn.ad-danger:hover {
  border-color: rgba(255, 143, 132, 0.6);
  background: rgba(214, 64, 52, 0.25);
}

.tour-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.td-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-av {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: hsl(var(--h, 0), 35%, 32%);
  font-size: 13px;
  font-weight: 800;
}

.ad-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-table td.td-team {
  color: var(--text-muted);
}

/* Toast */
.admin-toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #0b0b0d;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.admin-toast.is-bad {
  background: #ff8f84;
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .ad-counts {
    grid-template-columns: repeat(2, 1fr);
  }

  .aform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .st-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .st-cards {
    grid-template-columns: 1fr 1fr;
  }

  .st-cards .st-card:first-child {
    grid-column: 1 / -1;
  }

  .lm-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .lm-nums {
    font-size: 26px;
  }

  .lm-team {
    font-size: 13px;
  }

  .aform-grid {
    grid-template-columns: 1fr;
  }

  .afield--wide {
    grid-column: auto;
  }

  .ad-item {
    flex-wrap: wrap;
  }

  .ad-item-actions {
    width: 100%;
  }

  .admin-toast {
    bottom: calc(var(--bottom-bar-h, 68px) + var(--bottom-gap, 10px) + 12px);
  }

  /* Sticky event column: narrower so the numbers are visible next to it */
  .td-event {
    min-width: 0;
    max-width: 150px;
    gap: 8px;
    white-space: normal;
  }

  .td-event .ev-name {
    font-size: 12px;
  }

  .st-table th,
  .st-table td {
    padding: 8px 8px;
  }

  /* Tab labels are long in RU/ES: let the three tabs shrink */
  .pstats-seg .seg-btn {
    padding: 0 6px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-skeleton span {
    animation: none;
  }

  .ch-dot,
  .admin-toast {
    transition: none;
  }
}
