:root {
  --bg: #070b12;
  --bg-2: #0d1420;
  --panel: #101826;
  --panel-2: #151f31;
  --panel-3: #1a263b;
  --line: rgba(145, 170, 214, 0.18);
  --line-strong: rgba(145, 170, 214, 0.34);
  --text: #eff4ff;
  --muted: #8b9aba;
  --accent: #7dd2ff;
  --accent-2: #ff6f91;
  --accent-3: #ffd166;
  --danger: #ff8ca8;
  --success: #8fe3b4;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: #314462 #0b111c;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Bahnschrift, "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(125, 210, 255, 0.12), transparent 22%),
    radial-gradient(circle at 86% 18%, rgba(255, 111, 145, 0.1), transparent 20%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 54%, #0b111c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(125, 210, 255, 0.045) 48%, transparent 100%);
  opacity: 0.5;
}

.admin-shell {
  width: min(1420px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.admin-shell.is-locked {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 28% 18%, rgba(125, 210, 255, 0.18), transparent 28%),
    radial-gradient(circle at 72% 72%, rgba(255, 111, 145, 0.14), transparent 26%),
    rgba(7, 11, 18, 0.98);
}

.login-screen.is-hidden {
  display: none;
}

.login-card {
  width: min(520px, 100%);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(21, 31, 49, 0.98), rgba(11, 17, 28, 0.98));
  box-shadow: var(--shadow);
}

.hero-panel,
.panel,
.sidebar-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(21, 31, 49, 0.96), rgba(14, 22, 35, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel::before,
.panel::before,
.sidebar-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0.9;
}

.hero-panel {
  padding: 2.1rem;
  margin-bottom: 1.5rem;
}

.panel,
.sidebar-panel {
  padding: 1.35rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.main-column {
  display: grid;
  gap: 1.5rem;
}

.sidebar-stack {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.sync-stack {
  margin-top: 1rem;
}

.sync-stack .status-message {
  margin-top: 0;
  line-height: 1.45;
}

.activity-nav {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.activity-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.activity-button:hover,
.activity-button.is-active {
  border-color: rgba(125, 210, 255, 0.34);
  background: linear-gradient(90deg, rgba(125, 210, 255, 0.16), rgba(255, 111, 145, 0.07));
  transform: translateY(-1px);
}

.activity-view {
  display: none;
  gap: 1.5rem;
}

.activity-view.is-active {
  display: grid;
}

.eyebrow,
.section-label,
.team-meta,
.player-meta,
.summary-card span {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--muted);
}

h1,
h2,
h3,
p,
summary {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.4rem, 4vw, 4.35rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero-copy,
.helper-copy {
  color: var(--muted);
  max-width: 68ch;
  line-height: 1.55;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.import-grid,
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-card,
.summary-card,
.details-shell {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012));
}

.summary-card {
  margin-top: 1rem;
  background:
    linear-gradient(135deg, rgba(125, 210, 255, 0.08), rgba(255, 111, 145, 0.05)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.summary-card strong {
  font-size: 2.8rem;
  line-height: 1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(145, 170, 214, 0.16);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: #ffffff;
  background: linear-gradient(180deg, #0a1019, #0c121d);
  outline: none;
}

.password-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 0.45rem;
  align-items: center;
}

.password-shell input {
  min-width: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button:hover {
  border-color: rgba(125, 210, 255, 0.42);
  background: rgba(125, 210, 255, 0.09);
  transform: translateY(-1px);
}

.eye-image {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  filter: invert(1);
  opacity: 0.9;
}

.eye-button[aria-pressed="true"] .eye-image {
  opacity: 1;
  filter: invert(1) drop-shadow(0 0 6px rgba(125, 210, 255, 0.45));
}

textarea {
  resize: vertical;
  min-height: 180px;
}

input[type="file"] {
  min-height: 52px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(125, 210, 255, 0.14);
}

select option {
  color: #ffffff;
  background: #0a1019;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
}

.primary-button,
.ghost-button,
.danger-button {
  position: relative;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-button {
  border: 0;
  color: #071019;
  background: linear-gradient(90deg, var(--accent-3), var(--accent));
}

.inline-link {
  display: inline-block;
  text-decoration: none;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.danger-button {
  border: 1px solid rgba(255, 140, 168, 0.28);
  color: #ffd9e3;
  background: rgba(255, 140, 168, 0.08);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.status-message {
  margin: 1rem 0 0;
  color: var(--muted);
}

.status-message.is-error {
  color: var(--danger);
}

.status-message.is-success {
  color: var(--success);
}

.team-list {
  display: grid;
  gap: 0.9rem;
}

.team-row {
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}

.team-row[open] {
  border-color: rgba(125, 210, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.team-summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(5, minmax(90px, 0.7fr)) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  background:
    linear-gradient(90deg, rgba(125, 210, 255, 0.03), transparent 28%, transparent 72%, rgba(255, 111, 145, 0.03));
}

.team-summary::-webkit-details-marker {
  display: none;
}

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

.summary-main h3,
.summary-cell strong {
  margin: 0;
}

.summary-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.summary-cell strong {
  font-size: 1rem;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.badge {
  padding: 0.26rem 0.58rem;
  border: 1px solid rgba(125, 210, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(125, 210, 255, 0.08);
  color: #d8f6ff;
}

.badge.is-danger {
  border-color: rgba(255, 140, 168, 0.18);
  background: rgba(255, 140, 168, 0.08);
  color: #ffd5df;
}

.summary-chevron {
  justify-self: end;
  color: var(--muted);
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.team-row[open] .summary-chevron {
  transform: rotate(180deg);
}

.team-details {
  padding: 0 1rem 1rem;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
}

.team-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.toggle-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.toggle input {
  width: auto;
  margin: 0;
}

.player-list {
  display: grid;
  gap: 0.8rem;
}

.player-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(145, 170, 214, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.008));
}

.icon-placeholder {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed rgba(125, 210, 255, 0.26);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem;
  background:
    linear-gradient(135deg, rgba(125, 210, 255, 0.04), rgba(255, 111, 145, 0.03));
}

.player-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.details-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.018);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.result-box {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.result-box.accent {
  background:
    linear-gradient(135deg, rgba(125, 210, 255, 0.12), rgba(255, 111, 145, 0.08)),
    rgba(255, 255, 255, 0.025);
}

.result-label {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--muted);
}

.result-box strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.15rem, 2vw, 1.85rem);
  line-height: 1.15;
}

.payload-box {
  margin-top: 1rem;
}

.payload-box pre {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font: 0.95rem/1.5 Consolas, "Courier New", monospace;
}

@media (max-width: 1180px) {
  .layout-grid,
  .import-grid,
  .filter-grid,
  .details-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .team-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100% - 1rem, 100%);
    padding: 1rem 0 2rem;
  }

  .hero-panel,
  .panel,
  .sidebar-panel {
    padding: 1.1rem;
    border-radius: 22px;
  }

  .team-summary,
  .team-controls {
    grid-template-columns: 1fr;
  }

  .toggle-row,
  .action-row,
  .details-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
