:root {
  color-scheme: dark;
  --bg: #090c12;
  --panel: rgba(17, 22, 32, 0.84);
  --panel-strong: #121824;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f7fb;
  --muted: #8f9bad;
  --accent: #8a5cff;
  --accent-2: #34d8ff;
  --success: #45e09b;
  --danger: #ff637d;
  --warning: #ffc75f;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(138, 92, 255, 0.10), transparent 35%),
    radial-gradient(circle at 90% 25%, rgba(52, 216, 255, 0.08), transparent 32%),
    linear-gradient(180deg, #090c12 0%, #0b1018 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.page-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.12;
}

.page-glow-one {
  top: -160px;
  left: -100px;
  background: var(--accent);
}

.page-glow-two {
  right: -150px;
  top: 280px;
  background: var(--accent-2);
}

.container {
  position: relative;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 32px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.eyebrow,
.panel-kicker {
  color: #b6c0cf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px var(--success);
}

h1 {
  margin: 12px 0 8px;
  max-width: 900px;
  font-size: clamp(38px, 5vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h2 {
  margin: 6px 0 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.separator {
  padding: 0 7px;
  color: #4f5a6d;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.updated-box {
  display: flex;
  min-width: 170px;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(17, 22, 32, 0.65);
}

.updated-box span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.updated-box strong {
  font-size: 13px;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), #6941cf);
  color: white;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(138, 92, 255, 0.24);
  transition: transform 160ms ease, filter 160ms ease;
}

.refresh-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.refresh-button.loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}

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

.stat-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(20, 26, 38, 0.92), rgba(13, 18, 27, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  position: relative;
  min-height: 152px;
  overflow: hidden;
  padding: 21px;
  border-radius: 18px;
}

.stat-card-main::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  bottom: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 92, 255, 0.45), transparent 70%);
}

.stat-label,
.stat-note {
  color: var(--muted);
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin: 17px 0 12px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-value-small {
  font-size: 27px;
}

.stat-note {
  font-size: 11px;
}

.success {
  color: var(--success);
}

.danger {
  color: var(--danger);
}

.muted {
  color: #586377;
}

.progress {
  height: 6px;
  overflow: hidden;
  margin-top: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 500ms ease;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.win {
  background: var(--success);
}

.legend-dot.loss {
  background: var(--danger);
}

.recent-form {
  display: grid;
  grid-template-columns: repeat(10, minmax(30px, 1fr));
  gap: 9px;
  min-height: 68px;
}

.form-item {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: #6d7889;
  font-size: 13px;
  font-weight: 900;
}

.form-item.win {
  border-color: rgba(69, 224, 155, 0.28);
  background: rgba(69, 224, 155, 0.09);
  color: var(--success);
}

.form-item.loss {
  border-color: rgba(255, 99, 125, 0.28);
  background: rgba(255, 99, 125, 0.08);
  color: var(--danger);
}

.form-item.active {
  border-color: rgba(52, 216, 255, 0.3);
  color: var(--accent-2);
}

.form-item.scheduled {
  color: var(--warning);
}

.split-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.split-stats div {
  padding: 16px;
  background: rgba(14, 19, 28, 0.96);
}

.split-stats span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.split-stats strong {
  font-size: 20px;
}

.top-players {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.top-player {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.player-rank {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: rgba(138, 92, 255, 0.13);
  color: #cdbdff;
  font-size: 12px;
  font-weight: 900;
}

.player-info {
  min-width: 0;
}

.player-info strong,
.capture-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info span,
.player-score span {
  color: var(--muted);
  font-size: 11px;
}

.player-score {
  text-align: right;
}

.player-score strong {
  display: block;
  font-size: 15px;
}

.captures-panel {
  margin-top: 14px;
}

.panel-header-wrap {
  align-items: flex-end;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.search {
  display: flex;
  min-width: 230px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8, 12, 18, 0.72);
}

.search span {
  color: var(--muted);
}

.search input,
.filters select {
  height: 42px;
  border: 0;
  outline: none;
  color: var(--text);
}

.search input {
  width: 100%;
  background: transparent;
}

.filters select {
  padding: 0 32px 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0d121b;
}

.captures-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr) minmax(130px, 0.6fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.022);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.capture-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 92, 255, 0.22);
  background: rgba(255, 255, 255, 0.035);
}

.capture-main {
  min-width: 0;
}

.capture-main span,
.capture-meta span,
.capture-date span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.capture-meta strong,
.capture-date strong {
  display: block;
  font-size: 13px;
}

.capture-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.capture-score div {
  text-align: right;
}

.capture-score span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.capture-score strong {
  font-size: 15px;
}

.badge {
  display: inline-flex;
  min-width: 90px;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.badge.win {
  background: rgba(69, 224, 155, 0.11);
  color: var(--success);
}

.badge.loss {
  background: rgba(255, 99, 125, 0.11);
  color: var(--danger);
}

.badge.active {
  background: rgba(52, 216, 255, 0.11);
  color: var(--accent-2);
}

.badge.scheduled,
.badge.cancelled {
  background: rgba(255, 199, 95, 0.1);
  color: var(--warning);
}

.role-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(138, 92, 255, 0.10);
  color: #c4b2ff;
  font-size: 10px;
  font-weight: 800;
}

.empty-state,
.error-box {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.error-box {
  margin-bottom: 14px;
  border-style: solid;
  border-color: rgba(255, 99, 125, 0.25);
  background: rgba(255, 99, 125, 0.07);
  color: #ffb1be;
  text-align: left;
}

.hidden {
  display: none !important;
}

footer {
  padding-top: 22px;
  color: #596476;
  font-size: 11px;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .capture-card {
    grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 0.8fr) minmax(130px, 0.7fr) auto;
  }

  .capture-score {
    display: none;
  }
}

@media (max-width: 860px) {
  .container {
    width: min(100% - 24px, 760px);
    padding-top: 24px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }

  .updated-box {
    flex: 1;
  }

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

  .panel-header-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    width: 100%;
    justify-content: flex-start;
  }

  .search {
    flex: 1 1 100%;
  }

  .capture-card {
    grid-template-columns: 1fr auto;
  }

  .capture-meta,
  .capture-date {
    display: none;
  }
}

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

  .stat-card {
    min-height: 138px;
    padding: 18px;
  }

  .stat-value {
    font-size: 29px;
  }

  .recent-form {
    grid-template-columns: repeat(5, 1fr);
  }

  .split-stats {
    grid-template-columns: 1fr;
  }

  .filters select {
    flex: 1;
    min-width: 150px;
  }

  .capture-card {
    gap: 10px;
    padding: 14px;
  }

  .badge {
    min-width: 78px;
  }
}

/* Tabs */
.dashboard-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 18, 27, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.dashboard-tab {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.dashboard-tab.active {
  background: linear-gradient(135deg, rgba(138, 92, 255, 0.24), rgba(52, 216, 255, 0.10));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(138, 92, 255, 0.22);
}

.tab-count {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #cdd5e2;
  font-size: 10px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
  animation: tab-fade 220ms ease;
}

@keyframes tab-fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Participants */
.participant-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-value-name {
  overflow: hidden;
  font-size: 21px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participants-panel {
  margin-top: 14px;
}

.panel-description {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.participant-filters .search {
  min-width: 260px;
}

.participants-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(6, 9, 14, 0.28);
}

.participants-table-header,
.participant-row {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.4fr)
    minmax(105px, 0.65fr)
    minmax(145px, 0.85fr)
    minmax(105px, 0.62fr)
    minmax(105px, 0.62fr)
    minmax(120px, 0.72fr)
    minmax(125px, 0.75fr)
    minmax(150px, 0.9fr);
  align-items: center;
  gap: 14px;
}

.participants-table-header {
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: #778397;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

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

.participant-row {
  min-height: 88px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.participant-row:last-child {
  border-bottom: 0;
}

.participant-row:hover {
  background: rgba(138, 92, 255, 0.035);
}

.participant-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.participant-position {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(138, 92, 255, 0.12);
  color: #cbbcff;
  font-size: 11px;
  font-weight: 900;
}

.participant-name {
  min-width: 0;
}

.participant-name > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-name > span {
  color: var(--muted);
  font-size: 10px;
}

.participant-cell {
  min-width: 0;
}

.participant-cell > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.participant-cell > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-progress {
  width: 84px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
}

.participant-form {
  display: flex !important;
  gap: 4px;
  margin-top: 7px;
}

.participant-form i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #596476;
}

.participant-form i.win {
  background: var(--success);
}

.participant-form i.loss {
  background: var(--danger);
}

.participant-form i.active {
  background: var(--accent-2);
}

.participant-form i.scheduled,
.participant-form i.cancelled {
  background: var(--warning);
}

.participant-no-form {
  display: block;
  margin-top: 6px;
  color: #586377 !important;
  font-size: 9px !important;
}

@media (max-width: 1280px) {
  .participants-table-header {
    display: none;
  }

  .participants-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .participant-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
  }

  .participant-row:last-child {
    border-bottom: 1px solid var(--line);
  }

  .participant-identity {
    grid-column: 1 / -1;
  }

  .participant-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #687488;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

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

@media (max-width: 620px) {
  .dashboard-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-tab {
    justify-content: center;
    padding: 0 10px;
    font-size: 12px;
  }

  .participant-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .participants-list {
    grid-template-columns: 1fr;
  }

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

  .participant-average {
    display: none;
  }

  .participant-filters {
    width: 100%;
  }

  .participant-filters .search,
  .participant-filters select {
    width: 100%;
  }
}

/* Detailed player statistics */
body.modal-open {
  overflow: hidden;
}

.participant-row-clickable {
  cursor: pointer;
}

.participant-row-clickable:hover {
  border-color: rgba(138, 92, 255, 0.28);
  background: rgba(138, 92, 255, 0.055);
}

.participant-row-clickable:focus-visible,
.top-player-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.top-player-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.player-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.player-modal.hidden {
  display: none;
}

.player-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.78);
  backdrop-filter: blur(14px);
}

.player-modal-card {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 26px;
  background:
    radial-gradient(circle at 0 0, rgba(138, 92, 255, 0.13), transparent 30%),
    linear-gradient(145deg, #121824, #0b1018);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.62);
  animation: player-modal-in 180ms ease;
}

@keyframes player-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.player-modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.player-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.player-modal-header {
  display: flex;
  align-items: center;
  gap: 17px;
  padding-right: 52px;
  margin-bottom: 24px;
}

.player-modal-avatar {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(138, 92, 255, 0.32);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(138, 92, 255, 0.28), rgba(52, 216, 255, 0.10));
  color: #e5dcff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: inset 0 0 25px rgba(138, 92, 255, 0.10);
}

.player-modal-heading h2 {
  margin-top: 5px;
  font-size: clamp(25px, 4vw, 36px);
}

.player-modal-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.player-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.player-detail-stat {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.player-detail-stat > span,
.player-detail-stat > small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.player-detail-stat > strong {
  display: block;
  margin: 13px 0 9px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.player-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.player-detail-panel,
.player-history-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
}

.player-detail-panel-title {
  margin-bottom: 18px;
}

.player-detail-panel-title h3,
.player-history-header h3 {
  margin: 5px 0 0;
  font-size: 19px;
}

.contribution-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.contribution-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.contribution-item span {
  color: var(--muted);
  font-size: 11px;
}

.contribution-item strong {
  font-size: 13px;
}

.contribution-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.contribution-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.player-detail-pairs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.player-detail-pairs > div,
.player-insights > div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.12);
}

.player-detail-pairs span,
.player-insights span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.player-detail-pairs strong,
.player-insights strong {
  display: block;
  font-size: 12px;
}

.player-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.player-insights strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-insights small {
  display: block;
  margin-top: 5px;
  color: #69758a;
  font-size: 9px;
}

.player-history-panel {
  margin-top: 12px;
}

.player-history-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.player-history-header > span {
  color: var(--muted);
  font-size: 11px;
}

.player-match-table-header,
.player-match-row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.4fr)
    minmax(110px, 0.7fr)
    minmax(105px, 0.62fr)
    minmax(105px, 0.62fr)
    minmax(145px, 0.8fr);
  align-items: center;
  gap: 13px;
}

.player-match-table-header {
  padding: 10px 13px;
  color: #687488;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.player-match-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.player-match-row {
  min-height: 70px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
}

.player-match-row:last-child {
  border-bottom: 0;
}

.player-match-main,
.player-match-cell {
  min-width: 0;
}

.player-match-main strong,
.player-match-cell strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-match-main span,
.player-match-cell span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-match-result {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.player-match-result .badge {
  min-width: 78px;
}

.mvp-chip {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 199, 95, 0.10);
  color: var(--warning);
  font-size: 9px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .player-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-detail-grid {
    grid-template-columns: 1fr;
  }

  .player-match-table-header {
    display: none;
  }

  .player-match-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 9px;
  }

  .player-match-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
  }

  .player-match-main,
  .player-match-result {
    grid-column: 1 / -1;
  }

  .player-match-result {
    justify-content: flex-start;
  }

  .player-match-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #687488;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
  }
}

@media (max-width: 620px) {
  .player-modal {
    align-items: end;
    padding: 0;
  }

  .player-modal-card {
    width: 100%;
    max-height: 94vh;
    padding: 20px 14px;
    border-radius: 24px 24px 0 0;
  }

  .player-modal-header {
    padding-right: 40px;
  }

  .player-modal-avatar {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .player-modal-heading p {
    font-size: 10px;
  }

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

  .player-detail-stat {
    min-height: 100px;
    padding: 13px;
  }

  .player-detail-stat > strong {
    font-size: 20px;
  }

  .player-detail-pairs,
  .player-insights {
    grid-template-columns: 1fr;
  }

  .player-match-list {
    grid-template-columns: 1fr;
  }
}

/* Detailed capture statistics */
.capture-card-clickable {
  cursor: pointer;
}

.capture-card-clickable:hover {
  border-color: rgba(52, 216, 255, 0.24);
  background: rgba(52, 216, 255, 0.035);
}

.capture-card-clickable:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.capture-modal {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.capture-modal.hidden {
  display: none;
}

.capture-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.82);
  backdrop-filter: blur(15px);
}

.capture-modal-card {
  position: relative;
  z-index: 1;
  width: min(1380px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 27px;
  background:
    radial-gradient(circle at 0 0, rgba(52, 216, 255, 0.10), transparent 28%),
    radial-gradient(circle at 100% 0, rgba(138, 92, 255, 0.10), transparent 32%),
    linear-gradient(145deg, #121824, #0b1018);
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.65);
  animation: player-modal-in 180ms ease;
}

.capture-modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.capture-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.capture-modal-header {
  display: flex;
  align-items: center;
  gap: 17px;
  padding-right: 52px;
  margin-bottom: 24px;
}

.capture-modal-icon {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(52, 216, 255, 0.30);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(52, 216, 255, 0.18), rgba(138, 92, 255, 0.12));
  color: var(--accent-2);
  font-size: 22px;
  font-weight: 900;
}

.capture-modal-icon.win {
  border-color: rgba(69, 224, 155, 0.35);
  color: var(--success);
}

.capture-modal-icon.loss {
  border-color: rgba(255, 99, 125, 0.35);
  color: var(--danger);
}

.capture-modal-heading h2 {
  margin-top: 5px;
  font-size: clamp(24px, 4vw, 36px);
}

.capture-modal-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.capture-detail-stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 9px;
}

.capture-detail-stats article {
  min-height: 105px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.024);
}

.capture-detail-stats span,
.capture-detail-stats small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.capture-detail-stats strong {
  display: block;
  overflow: hidden;
  margin: 13px 0 8px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  align-items: stretch;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
}

.capture-score-team {
  padding: 20px;
  text-align: center;
}

.capture-score-team.winner {
  background: rgba(69, 224, 155, 0.055);
}

.capture-score-team > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.capture-score-team > strong {
  display: block;
  margin: 8px 0 15px;
  font-size: 21px;
}

.capture-score-team > div {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #cdd5e2;
  font-size: 13px;
}

.capture-score-divider {
  display: grid;
  place-items: center;
  border-inline: 1px solid var(--line);
  color: #69758a;
  font-size: 13px;
  font-weight: 900;
}

.capture-teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.capture-team-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.021);
}

.capture-team-panel.winner {
  border-color: rgba(69, 224, 155, 0.26);
  box-shadow: inset 0 0 35px rgba(69, 224, 155, 0.025);
}

.capture-team-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.capture-team-header h3 {
  margin: 7px 0 4px;
  font-size: 19px;
}

.capture-team-header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.capture-side-label {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.capture-side-label.attackers {
  background: rgba(255, 99, 125, 0.10);
  color: var(--danger);
}

.capture-side-label.defenders {
  background: rgba(52, 216, 255, 0.10);
  color: var(--accent-2);
}

.capture-team-result {
  text-align: right;
}

.capture-team-result strong,
.capture-team-result > span:not(.winner-chip) {
  display: block;
}

.capture-team-result strong {
  margin-top: 8px;
  font-size: 17px;
}

.capture-team-result > span:not(.winner-chip) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.winner-chip {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(69, 224, 155, 0.11);
  color: var(--success);
  font-size: 9px;
  font-weight: 900;
}

.capture-team-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.capture-team-summary div {
  padding: 12px;
  background: rgba(10, 14, 21, 0.96);
}

.capture-team-summary span,
.capture-team-summary strong {
  display: block;
}

.capture-team-summary span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
}

.capture-team-summary strong {
  font-size: 14px;
}

.capture-player-table-header,
.capture-player-row {
  display: grid;
  grid-template-columns: minmax(175px, 1.35fr) minmax(85px, 0.55fr) minmax(100px, 0.65fr) minmax(115px, 0.72fr) 58px;
  align-items: center;
  gap: 11px;
}

.capture-player-table-header {
  padding: 10px 13px;
  color: #687488;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.capture-player-list {
  border-top: 1px solid var(--line);
}

.capture-player-row {
  min-height: 64px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.capture-player-row:last-child {
  border-bottom: 0;
}

.capture-player-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.capture-player-rank,
.capture-leader-position {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(138, 92, 255, 0.11);
  color: #cbbcff;
  font-size: 9px;
  font-weight: 900;
}

.capture-player-identity strong,
.capture-player-cell strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-player-identity span:not(.capture-player-rank),
.capture-player-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.capture-player-flags {
  text-align: right;
}


@media (max-width: 1180px) {
  .capture-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .capture-teams-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .capture-modal {
    align-items: end;
    padding: 0;
  }

  .capture-modal-card {
    width: 100%;
    max-height: 95vh;
    padding: 20px 14px;
    border-radius: 24px 24px 0 0;
  }

  .capture-modal-header {
    padding-right: 40px;
  }

  .capture-modal-icon {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

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

  .capture-scoreboard {
    grid-template-columns: 1fr;
  }

  .capture-score-divider {
    min-height: 44px;
    border: 0;
    border-block: 1px solid var(--line);
  }

  .capture-player-table-header {
    display: none;
  }

  .capture-player-list {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .capture-player-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .capture-player-identity,
  .capture-player-flags {
    grid-column: 1 / -1;
  }

  .capture-player-flags {
    text-align: left;
  }

  .capture-player-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #687488;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
  }
}

/* Clickable recent matches */
.form-item-button {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.form-item-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.form-item-button:active {
  transform: translateY(-1px);
}

.form-item-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Clickable wins and losses cards */
.stat-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.stat-card-button:hover {
  transform: translateY(-3px);
  border-color: rgba(138, 92, 255, 0.28);
  background: linear-gradient(
    145deg,
    rgba(27, 34, 50, 0.96),
    rgba(15, 21, 31, 0.92)
  );
}

.stat-card-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.stat-card-button.selected {
  border-color: rgba(138, 92, 255, 0.5);
  box-shadow:
    0 0 0 1px rgba(138, 92, 255, 0.16),
    0 18px 50px rgba(0, 0, 0, 0.32);
}

.stat-card-button.selected .stat-note {
  color: #c8bbff;
}

/* Family name home link */
.family-home-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 160ms ease,
    text-shadow 160ms ease,
    opacity 160ms ease;
}

.family-home-link:hover {
  color: #ffffff;
  text-shadow: 0 0 28px rgba(138, 92, 255, 0.32);
}

.family-home-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 6px;
  border-radius: 6px;
}

/* Attack / defense ratio */
.role-progress {
  display: flex;
  width: 100%;
  height: 6px;
  overflow: hidden;
  margin-top: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.role-progress span {
  display: block;
  height: 100%;
  transition: width 500ms ease;
}

.role-progress-attacks {
  background: linear-gradient(90deg, var(--accent), #a57cff);
}

.role-progress-defenses {
  background: linear-gradient(90deg, var(--accent-2), #46e0c2);
}

/* Player capture-by-capture timeline */
.player-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-timeline-item {
  display: grid;
  grid-template-columns:
    minmax(130px, 0.8fr)
    minmax(210px, 1.35fr)
    minmax(95px, 0.55fr)
    minmax(105px, 0.62fr)
    minmax(135px, 0.75fr);
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.player-timeline-item:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 92, 255, 0.24);
  background: rgba(138, 92, 255, 0.04);
}

.player-timeline-date,
.player-timeline-match,
.player-timeline-stat {
  min-width: 0;
}

.player-timeline-date strong,
.player-timeline-match strong,
.player-timeline-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-timeline-date strong {
  color: #ddd5ff;
  font-size: 13px;
}

.player-timeline-date span,
.player-timeline-match span,
.player-timeline-stat span,
.player-timeline-stat small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-timeline-match strong {
  font-size: 12px;
}

.player-timeline-stat > span {
  margin-top: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.player-timeline-stat strong {
  font-size: 17px;
}

.player-timeline-result {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

@media (max-width: 900px) {
  .player-timeline-item {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .player-timeline-date,
  .player-timeline-match,
  .player-timeline-result {
    grid-column: 1 / -1;
  }

  .player-timeline-result {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .player-timeline-item {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px;
  }

  .player-timeline-date strong {
    font-size: 14px;
  }

  .player-timeline-stat strong {
    font-size: 16px;
  }
}

/* Player date period filter */
.player-period-panel {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(138, 92, 255, 0.07),
      rgba(52, 216, 255, 0.025)
    );
}

.player-period-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.player-period-heading h3 {
  margin: 5px 0 0;
  font-size: 18px;
}

.player-period-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.player-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.player-period-button,
.player-date-reset {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.player-period-button:hover,
.player-date-reset:hover {
  border-color: rgba(138, 92, 255, 0.34);
  color: var(--text);
}

.player-period-button.active {
  border-color: rgba(138, 92, 255, 0.42);
  background: rgba(138, 92, 255, 0.16);
  color: #e1d9ff;
}

.player-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
}

.player-date-range label {
  display: flex;
  min-width: 170px;
  flex: 1 1 190px;
  flex-direction: column;
  gap: 6px;
}

.player-date-range label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.player-date-range input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #0c1119;
  color: var(--text);
  color-scheme: dark;
}

.player-date-range input:focus {
  border-color: rgba(52, 216, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(52, 216, 255, 0.07);
}

.player-date-reset {
  flex: 0 0 auto;
  color: #cbbcff;
}

@media (max-width: 620px) {
  .player-period-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-period-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .player-period-button {
    padding: 0 8px;
  }

  .player-date-range {
    display: grid;
    grid-template-columns: 1fr;
  }

  .player-date-range label,
  .player-date-reset {
    width: 100%;
    min-width: 0;
  }
}

/* Roster date filter */
.participants-period-toolbar {
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(
      145deg,
      rgba(138, 92, 255, 0.065),
      rgba(52, 216, 255, 0.022)
    );
}

.participants-period-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.participants-period-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.participants-period-summary > span {
  color: var(--muted);
  font-size: 10px;
}

.participants-period-controls {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.participants-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.participants-period-button,
.participants-date-reset {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.participants-period-button:hover,
.participants-date-reset:hover {
  border-color: rgba(138, 92, 255, 0.34);
  color: var(--text);
}

.participants-period-button.active,
.participants-date-reset.active {
  border-color: rgba(138, 92, 255, 0.42);
  background: rgba(138, 92, 255, 0.16);
  color: #e1d9ff;
}

.participants-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
}

.participants-date-range label {
  display: flex;
  min-width: 170px;
  flex: 1 1 190px;
  flex-direction: column;
  gap: 6px;
}

.participants-date-range label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.participants-date-range input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #0c1119;
  color: var(--text);
  color-scheme: dark;
}

.participants-date-range input:focus {
  border-color: rgba(52, 216, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(52, 216, 255, 0.07);
}

.participants-date-reset {
  flex: 0 0 auto;
  color: #cbbcff;
}

@media (max-width: 620px) {
  .participants-period-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .participants-period-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .participants-period-button {
    padding: 0 8px;
  }

  .participants-date-range {
    display: grid;
    grid-template-columns: 1fr;
  }

  .participants-date-range label,
  .participants-date-reset {
    width: 100%;
    min-width: 0;
  }
}

/* Clickable matches in player history */
.player-timeline-item-clickable {
  cursor: pointer;
}

.player-timeline-item-clickable:hover {
  border-color: rgba(138, 92, 255, 0.38);
  background: rgba(138, 92, 255, 0.07);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.player-timeline-item-clickable:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.player-timeline-item-clickable:active {
  transform: translateY(0);
}

/* Family capture history date filter */
.captures-period-toolbar {
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(
      145deg,
      rgba(138, 92, 255, 0.065),
      rgba(52, 216, 255, 0.022)
    );
}

.captures-period-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.captures-period-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.captures-period-summary > span {
  color: var(--muted);
  font-size: 10px;
}

.captures-period-controls {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.captures-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.captures-period-button,
.captures-date-reset {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.captures-period-button:hover,
.captures-date-reset:hover {
  border-color: rgba(138, 92, 255, 0.34);
  color: var(--text);
}

.captures-period-button.active,
.captures-date-reset.active {
  border-color: rgba(138, 92, 255, 0.42);
  background: rgba(138, 92, 255, 0.16);
  color: #e1d9ff;
}

.captures-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
}

.captures-date-range label {
  display: flex;
  min-width: 170px;
  flex: 1 1 190px;
  flex-direction: column;
  gap: 6px;
}

.captures-date-range label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.captures-date-range input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #0c1119;
  color: var(--text);
  color-scheme: dark;
}

.captures-date-range input:focus {
  border-color: rgba(52, 216, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(52, 216, 255, 0.07);
}

.captures-date-reset {
  flex: 0 0 auto;
  color: #cbbcff;
}

@media (max-width: 620px) {
  .captures-period-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .captures-period-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .captures-period-button {
    padding: 0 8px;
  }

  .captures-date-range {
    display: grid;
    grid-template-columns: 1fr;
  }

  .captures-date-range label,
  .captures-date-reset {
    width: 100%;
    min-width: 0;
  }
}

/* Clickable total captures card */
#totalCapturesCard:hover {
  border-color: rgba(138, 92, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(138, 92, 255, 0.12),
    0 20px 54px rgba(0, 0, 0, 0.34);
}

/* Authentication and account management */
.account-box {
  display: flex;
  min-width: 250px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(17, 22, 32, 0.72);
}

.account-copy {
  min-width: 0;
}

.account-copy span,
.account-copy small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.account-copy strong {
  display: block;
  overflow: hidden;
  margin: 3px 0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions,
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-actions form,
.admin-header-actions form {
  margin: 0;
}

.account-link,
.account-logout,
.admin-primary-button,
.admin-secondary-button,
.admin-danger-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.account-link {
  background: rgba(138, 92, 255, 0.12);
  color: #d6caff;
}

.account-logout {
  background: rgba(255, 99, 125, 0.08);
  color: #ffacba;
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.auth-shell {
  position: relative;
  width: min(100% - 28px, 470px);
  padding: 34px 0;
}

.auth-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(
      145deg,
      rgba(20, 26, 38, 0.96),
      rgba(13, 18, 27, 0.94)
    );
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b6c0cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.auth-heading {
  margin: 34px 0 24px;
}

.auth-heading h1 {
  margin: 8px 0 12px;
  font-size: clamp(38px, 9vw, 56px);
}

.auth-heading p,
.auth-footnote {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form,
.admin-create-form,
.admin-edit-form,
.admin-password-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.admin-create-form label,
.admin-edit-form label,
.admin-password-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-form label > span,
.admin-create-form label > span,
.admin-edit-form label > span,
.admin-password-form label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-form input,
.admin-create-form input,
.admin-create-form select,
.admin-edit-form input,
.admin-edit-form select,
.admin-password-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #0c1119;
  color: var(--text);
}

.auth-form input:focus,
.admin-create-form input:focus,
.admin-create-form select:focus,
.admin-edit-form input:focus,
.admin-edit-form select:focus,
.admin-password-form input:focus {
  border-color: rgba(52, 216, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(52, 216, 255, 0.07);
}

.auth-submit,
.admin-primary-button {
  min-height: 46px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #6941cf);
  color: white;
  box-shadow: 0 12px 30px rgba(138, 92, 255, 0.22);
}

.auth-submit {
  margin-top: 5px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}

.auth-footnote {
  margin-top: 20px;
  font-size: 11px;
  text-align: center;
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.flash-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11px;
}

.flash-message.error {
  border-color: rgba(255, 99, 125, 0.28);
  background: rgba(255, 99, 125, 0.08);
  color: #ffb1be;
}

.flash-message.success {
  border-color: rgba(69, 224, 155, 0.28);
  background: rgba(69, 224, 155, 0.08);
  color: #a8f2cf;
}

.admin-container {
  width: min(1280px, calc(100% - 40px));
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.admin-header h1 {
  margin-bottom: 10px;
  font-size: clamp(36px, 5vw, 62px);
}

.admin-create-panel {
  margin-bottom: 14px;
}

.admin-create-form {
  grid-template-columns:
    minmax(140px, 1fr)
    minmax(160px, 1fr)
    minmax(180px, 1fr)
    minmax(150px, 0.7fr)
    auto;
  align-items: end;
}

.admin-primary-button {
  padding: 0 18px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.022);
}

.admin-user-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: rgba(138, 92, 255, 0.15);
  color: #d8ceff;
  font-weight: 900;
}

.admin-user-summary strong,
.admin-user-summary span {
  display: block;
}

.admin-user-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.admin-role-badge,
.admin-status-badge {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.admin-role-badge.admin {
  background: rgba(138, 92, 255, 0.14);
  color: #d5c8ff;
}

.admin-role-badge.user {
  background: rgba(52, 216, 255, 0.10);
  color: #99ebff;
}

.admin-status-badge.active {
  background: rgba(69, 224, 155, 0.10);
  color: #9df0c7;
}

.admin-status-badge.disabled {
  background: rgba(255, 99, 125, 0.10);
  color: #ffacba;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 9px;
}

.admin-edit-form {
  grid-template-columns:
    minmax(140px, 1fr)
    minmax(160px, 1fr)
    minmax(150px, 0.7fr)
    minmax(150px, 0.7fr)
    auto;
  align-items: end;
}

.admin-active-toggle {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: row !important;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1119;
}

.admin-active-toggle input {
  width: 17px;
  height: 17px;
}

.admin-active-toggle span {
  text-transform: none !important;
}

.admin-secondary-button {
  background: rgba(138, 92, 255, 0.11);
  color: #d4c7ff;
}

.admin-danger-button {
  background: rgba(255, 99, 125, 0.08);
  color: #ffacba;
}

.admin-danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.admin-user-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-password-form {
  grid-template-columns: minmax(220px, 340px) auto;
  align-items: end;
}

.admin-user-count {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .hero-actions {
    flex-wrap: wrap;
  }

  .account-box {
    order: -1;
    width: 100%;
  }

  .admin-create-form,
  .admin-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-primary-button,
  .admin-edit-form .admin-secondary-button {
    min-height: 44px;
  }
}

@media (max-width: 700px) {
  .auth-card {
    padding: 24px;
  }

  .admin-header,
  .admin-user-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-header-actions {
    justify-content: flex-start;
  }

  .admin-create-form,
  .admin-edit-form,
  .admin-password-form {
    grid-template-columns: 1fr;
  }

  .admin-user-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-user-badges {
    width: 100%;
    margin-left: 54px;
  }
}

/* Moderator role */
.admin-role-badge.moderator {
  background: rgba(255, 199, 95, 0.11);
  color: #ffd98a;
}

.admin-readonly-notice {
  margin-top: 13px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 199, 95, 0.18);
  border-radius: 12px;
  background: rgba(255, 199, 95, 0.055);
  color: #d8c69d;
  font-size: 10px;
  line-height: 1.55;
}

/* Administrator and Admin hierarchy */
.admin-role-badge.administrator {
  background: rgba(138, 92, 255, 0.18);
  color: #e1d8ff;
  box-shadow: inset 0 0 0 1px rgba(138, 92, 255, 0.18);
}

.admin-role-badge.admin {
  background: rgba(52, 216, 255, 0.11);
  color: #9cecff;
}

/* Prominent return-to-home button in account management */
.admin-home-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid rgba(138, 92, 255, 0.36);
  border-radius: 11px;
  background: linear-gradient(
    135deg,
    rgba(138, 92, 255, 0.2),
    rgba(105, 65, 207, 0.14)
  );
  color: #e2daff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(138, 92, 255, 0.12);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.admin-home-button:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 92, 255, 0.58);
  background: linear-gradient(
    135deg,
    rgba(138, 92, 255, 0.28),
    rgba(105, 65, 207, 0.2)
  );
}

.admin-home-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Live account presence */
.admin-presence-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.admin-presence-badge i {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.admin-presence-badge.online {
  border: 1px solid rgba(69, 224, 155, 0.2);
  background: rgba(69, 224, 155, 0.1);
  color: #a8f2cf;
}

.admin-presence-badge.online i {
  background: var(--success);
  box-shadow: 0 0 12px rgba(69, 224, 155, 0.9);
  animation: presence-pulse 1.8s ease-in-out infinite;
}

.admin-presence-badge.offline {
  border: 1px solid rgba(143, 155, 173, 0.14);
  background: rgba(143, 155, 173, 0.07);
  color: #a6afbd;
}

.admin-presence-badge.offline i {
  background: #697486;
}

@keyframes presence-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}
