:root {
  --bg: #f4efe4;
  --bg-accent: #e9dcc4;
  --panel: rgba(255, 251, 245, 0.82);
  --panel-strong: rgba(255, 248, 238, 0.96);
  --border: rgba(84, 57, 32, 0.16);
  --text: #1d1a17;
  --muted: #6f6358;
  --accent: #0c7c59;
  --accent-strong: #0a6a4c;
  --accent-soft: #d9f3e8;
  --accent-line: rgba(12, 124, 89, 0.2);
  --alert: #a33b20;
  --alert-soft: #f6ddd5;
  --shadow: 0 18px 45px rgba(86, 61, 35, 0.15);
  --radius-panel: 28px;
  --radius-card: 20px;
  --radius-pill: 999px;
  --shell-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(12, 124, 89, 0.15), transparent 28%),
    radial-gradient(circle at right, rgba(163, 59, 32, 0.12), transparent 24%),
    linear-gradient(160deg, var(--bg) 0%, #f8f2e8 44%, var(--bg-accent) 100%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

pre,
code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.page-shell {
  width: min(var(--shell-width), calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.hero,
.panel,
.surface-card {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero,
.panel {
  border-radius: var(--radius-panel);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 28px;
}

.hero-copy-block {
  display: grid;
  gap: 12px;
  max-width: 52rem;
}

.hero-actions,
.hero-status,
.chip-row,
.link-row,
.button-row,
.top-nav,
.title-row,
.stat-grid,
.admin-grid,
.field-grid,
.split-grid,
.info-grid,
.table-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.45rem);
  line-height: 0.94;
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

p {
  margin: 0;
}

.hero-copy,
.section-copy,
.muted,
.help-text,
.meta-copy,
.empty {
  color: var(--muted);
}

.hero-copy {
  font-size: 1.1rem;
  line-height: 1.45;
}

.status-chip,
.meta-chip,
.pill-link,
.pill-label,
.stat-label,
.seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
}

.status-chip,
.meta-chip,
.pill-link.is-active {
  background: var(--accent-soft);
  border-color: rgba(12, 124, 89, 0.18);
  color: var(--accent);
}

.status-chip.muted,
.meta-chip.muted,
.pill-link,
.pill-label {
  background: rgba(29, 26, 23, 0.06);
  border-color: rgba(84, 57, 32, 0.09);
  color: var(--muted);
}

.pill-button {
  cursor: pointer;
  font: inherit;
}

.pill-link:hover,
.button-secondary:hover,
.button-link:hover,
button:hover {
  transform: translateY(-1px);
}

.panel {
  padding: 22px;
}

.panel-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-copy {
  margin-top: 6px;
  color: var(--muted);
}

.surface-card,
.stat-card,
.nav-card,
.data-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.surface-card,
.stat-card,
.nav-card,
.data-card {
  padding: 18px;
}

.nav-grid,
.stat-grid,
.info-grid {
  display: grid;
  gap: 14px;
}

.nav-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.nav-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.nav-card:hover,
.stat-card:hover,
.standings-table tbody tr:hover {
  border-color: var(--accent-line);
}

.nav-card-title,
.stat-value,
.rank-value {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.nav-card-title {
  font-size: 1.35rem;
}

.button-primary,
.button-secondary,
.button-link,
button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 11px 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.button-primary,
button {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover,
button:hover {
  filter: brightness(1.03);
}

.button-secondary,
.button-link {
  background: rgba(29, 26, 23, 0.08);
  color: var(--text);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(12, 124, 89, 0.18);
  outline-offset: 1px;
  border-color: rgba(12, 124, 89, 0.28);
}

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

label,
.field-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.field-label span,
label span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.field-stack {
  display: grid;
  gap: 14px;
}

.info-grid {
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: start;
}

.stat-card {
  display: grid;
  gap: 8px;
}

.stat-label {
  min-height: auto;
  width: fit-content;
  padding: 6px 10px;
  background: rgba(29, 26, 23, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.65rem;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
}

.standings-table,
.squad-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th,
.standings-table td,
.squad-table th,
.squad-table td,
.admin-table th,
.admin-table td {
  padding: 0.9rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(84, 57, 32, 0.08);
}

.standings-table th,
.squad-table th,
.admin-table th {
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.standings-table tbody tr,
.squad-table tbody tr,
.admin-table tbody tr {
  transition: background 140ms ease, border-color 140ms ease;
}

.rank-cell {
  width: 92px;
}

.rank-value {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(12, 124, 89, 0.1);
  color: var(--accent-strong);
}

.team-link,
.inline-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.team-link:hover,
.inline-link:hover {
  text-decoration: underline;
}

.captain-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  vertical-align: middle;
}

.empty-state,
.code-block {
  border-radius: var(--radius-card);
  border: 1px solid rgba(84, 57, 32, 0.1);
  background: rgba(255, 251, 245, 0.88);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.code-block {
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-page {
  display: grid;
  gap: 18px;
}

.admin-toolbar,
.actions,
.secondary-actions {
  display: grid;
  gap: 12px;
}

.admin-toolbar {
  grid-template-columns: 1.1fr minmax(240px, 0.9fr);
  align-items: start;
}

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

.split-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 18px;
}

.actions-cell {
  width: 96px;
}

.actions-cell button,
.admin-table td input {
  margin: 0;
}

details {
  margin-top: 18px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.page-note {
  margin-top: 8px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero,
  .admin-toolbar,
  .split-grid,
  .info-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-status {
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw, calc(100vw - 16px));
    padding-top: 12px;
  }

  .panel,
  .hero,
  .surface-card,
  .stat-card,
  .nav-card,
  .data-card {
    padding: 16px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.3rem, 12vw, 3.5rem);
  }

  .actions,
  .secondary-actions,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .admin-toolbar,
  .split-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero-status,
  .button-row {
    width: 100%;
  }

  .hero-status > * {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .button-row > * {
    width: 100%;
  }

  .standings-table th,
  .standings-table td,
  .squad-table th,
  .squad-table td,
  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.6rem;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: calc(100vw - 12px);
    padding: 8px 0 24px;
  }

  .page-stack,
  .admin-page,
  .team-page,
  .sidebar-stack,
  .bench-list,
  .summary-list,
  .lineup-grid,
  .lineup-list,
  .builder-form,
  .builder-sidebar,
  .builder-main {
    gap: 14px;
  }

  .hero,
  .panel,
  .surface-card,
  .stat-card,
  .nav-card,
  .data-card {
    padding: 14px;
    border-radius: 20px;
  }

  .hero {
    gap: 14px;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .chip-row,
  .top-nav,
  .title-row,
  .field-grid,
  .tools-bar,
  .team-toolbar,
  .team-toolbar-actions,
  .inline-actions,
  .lineup-toolbar,
  .player-actions,
  .bench-item,
  .summary-item,
  .lineup-player,
  .lineup-actions {
    gap: 10px;
  }

  .chip-row,
  .tools-bar,
  .team-toolbar,
  .team-toolbar-actions,
  .inline-actions,
  .lineup-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-bar > *,
  .team-toolbar-actions > *,
  .inline-actions > *,
  .lineup-toolbar > * {
    width: 100%;
  }

  .search-input,
  .sort-select {
    max-width: none;
    width: 100%;
    min-width: 0;
  }

  .actions,
  .secondary-actions {
    gap: 10px;
  }

  .admin-table th,
  .admin-table td,
  .standings-table th,
  .standings-table td,
  .squad-table th,
  .squad-table td {
    padding: 0.65rem 0.55rem;
    font-size: 0.92rem;
  }

  .rank-cell {
    width: 68px;
  }

  .rank-value {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .actions-cell {
    width: 84px;
  }

  .code-block {
    padding: 12px;
    font-size: 0.9rem;
  }

  .lineup-card,
  .stat-card,
  .nav-card,
  .surface-card {
    padding: 14px;
  }
}

.player-link {
  color: inherit;
  text-decoration: none;
}

.player-link:hover {
  text-decoration: underline;
}

.captain-row td {
  background: rgba(12, 124, 89, 0.08);
  font-weight: 600;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn,
.chip-button,
.ghost-button,
.primary-button,
.lineup-save-btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 0.85rem;
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tools-bar,
.team-toolbar,
.team-toolbar-actions,
.transfer-inline,
.inline-actions,
.lineup-toolbar,
.player-card-header,
.player-actions,
.bench-item,
.summary-item,
.lineup-player,
.lineup-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tools-bar {
  margin-bottom: 12px;
  align-items: center;
}

.search-input,
.sort-select {
  font-size: 0.9rem;
}

.search-input {
  max-width: 280px;
}

.sort-select {
  width: auto;
  min-width: 170px;
}

.results-summary {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.team-page,
.sidebar-stack,
.bench-list,
.summary-list,
.transfer-panel,
.lineup-grid,
.lineup-list,
.builder-form,
.builder-sidebar,
.builder-main {
  display: grid;
  gap: 20px;
}

.team-toolbar,
.lineup-toolbar {
  justify-content: space-between;
  align-items: center;
}

.team-toolbar-actions {
  gap: 10px;
}

.ghost-button,
.primary-button,
.lineup-save-btn {
  padding: 10px 14px;
}

.ghost-button {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(84, 57, 32, 0.14);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
}

.primary-button {
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 16px 28px rgba(12, 124, 89, 0.24);
}

.ghost-button:hover,
.primary-button:hover,
.filter-btn:hover,
.chip-button:hover,
.lineup-save-btn:hover,
.inline-actions button:hover,
.lineup-actions button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.team-board,
.builder-grid {
  display: grid;
  gap: 20px;
  align-items: start;
}

.team-board {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.95fr);
}

.builder-grid {
  grid-template-columns: 300px 1fr;
}

.builder-sidebar,
.builder-main {
  min-width: 0;
}

.pitch-panel {
  position: relative;
  overflow: hidden;
}

.pitch-surface {
  position: relative;
  border-radius: 24px;
  padding: 22px;
  min-height: 760px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(17, 94, 54, 0.96) 0%, rgba(22, 118, 68, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pitch-surface::before,
.pitch-surface::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.pitch-surface::after {
  inset: 22px 50%;
  border-radius: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
  border-right: none;
  border-top: none;
  border-bottom: none;
}

.pitch-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: #fff;
}

.pitch-title {
  margin: 0;
  font-size: 1.3rem;
}

.pitch-subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
}

.formation-pill {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pitch-lines,
.pitch-line {
  position: relative;
  z-index: 1;
  display: grid;
}

.pitch-lines {
  gap: 20px;
}

.pitch-selection-tray {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pitch-selection-tray.is-empty {
  color: rgba(255, 255, 255, 0.82);
}

.pitch-selection-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pitch-selection-copy {
  display: grid;
  gap: 4px;
}

.pitch-selection-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
}

.pitch-selection-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.pitch-selection-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.pitch-selection-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pitch-action-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, color 140ms ease;
}

.pitch-action-button:hover {
  transform: translateY(-1px);
}

.pitch-action-button.primary {
  background: rgba(255, 255, 255, 0.94);
  color: #174536;
}

.pitch-action-button.secondary {
  background: rgba(12, 27, 22, 0.34);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pitch-action-button.is-active {
  background: rgba(217, 243, 232, 0.94);
  color: var(--accent-strong);
}

.pitch-line {
  gap: 14px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border-radius: 18px;
  transition: box-shadow 140ms ease, background 140ms ease;
}

.pitch-line.is-drop-target,
.bench-list.is-drop-target {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(217, 243, 232, 0.42);
}

.player-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  border-radius: 18px;
  padding: 12px 12px 10px;
  background: rgba(255, 251, 247, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 20px rgba(12, 18, 28, 0.12);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.player-card.is-captain {
  border-color: rgba(217, 243, 232, 0.64);
  box-shadow: 0 14px 24px rgba(12, 124, 89, 0.16);
}

.player-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 28px rgba(12, 18, 28, 0.18), 0 0 0 3px rgba(217, 243, 232, 0.26);
  background: rgba(255, 255, 255, 0.98);
}

.player-card.is-drag-source,
.bench-item.is-drag-source {
  opacity: 0.28;
}

.player-card.is-drop-marker,
.bench-item.is-drop-marker {
  box-shadow: 0 0 0 3px rgba(217, 243, 232, 0.42);
  border-color: rgba(217, 243, 232, 0.78);
}

.is-drag-ghost {
  position: fixed;
  margin: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.96;
  transform: scale(1.02);
  box-shadow: 0 22px 38px rgba(12, 18, 28, 0.26);
 }

.player-card-header {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player-card-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.player-name,
.lineup-player-name {
  font-weight: 700;
  color: var(--text);
}

.player-name {
  font-size: 0.98rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.player-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.player-card-topline-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(12, 124, 89, 0.12);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.player-meta,
.lineup-player-subtext,
.muted-small,
.interactive-note {
  color: var(--muted);
}

.player-meta,
.muted-small,
.interactive-note,
.lineup-player-subtext {
  font-size: 0.85rem;
  line-height: 1.28;
}

.player-points {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 0.86rem;
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(12, 124, 89, 0.1);
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(84, 57, 32, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  touch-action: none;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.player-fixture {
  color: rgba(29, 26, 23, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chip-button,
.inline-actions button,
.lineup-actions button {
  border: 1px solid rgba(84, 57, 32, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.chip-button.is-active {
  background: rgba(12, 124, 89, 0.12);
  border-color: rgba(12, 124, 89, 0.26);
  color: var(--accent-strong);
}

.bench-item,
.summary-item,
.lineup-card,
.lineup-player,
.status-box,
.empty-note {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(84, 57, 32, 0.08);
}

.bench-item,
.summary-item,
.lineup-player {
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
}

.bench-list {
  border-radius: 18px;
  transition: box-shadow 140ms ease, background 140ms ease;
}

.bench-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(163, 59, 32, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.85rem;
}

.summary-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-value {
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.status-banner,
.status-box {
  padding: 12px 14px;
  min-height: 24px;
  white-space: pre-wrap;
}

.status-banner {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(84, 57, 32, 0.08);
  color: var(--text);
}

.status-banner.success,
.status-box.success {
  background: rgba(236, 253, 245, 0.95);
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.status-banner.error,
.status-box.error {
  background: rgba(255, 241, 242, 0.95);
  border-color: rgba(244, 63, 94, 0.22);
  color: #9f1239;
}

.status-banner.is-pending {
  background: rgba(255, 251, 235, 0.95);
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

.builder-form {
  gap: 12px;
}

.transfer-panel {
  gap: 12px;
}

.transfer-panel label,
.transfer-inline label {
  display: grid;
  gap: 8px;
}

.builder-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.builder-form select,
.builder-form input,
.builder-form button {
  width: 100%;
}

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

.empty-note {
  padding: 16px;
  border-style: dashed;
  color: var(--muted);
}

.lineup-grid {
  gap: 16px;
}

.lineup-card {
  padding: 16px;
}

.lineup-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.lineup-list {
  gap: 10px;
  margin-top: 12px;
}

.lineup-player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lineup-actions {
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  align-self: center;
}

.lineup-toolbar {
  margin-bottom: 16px;
}

.lineup-save-btn {
  border-radius: 14px;
  border: none;
  background: var(--accent-strong);
  color: #fff;
}

.section-hidden {
  display: none;
}

.builder-main .panel {
  overflow: hidden;
}

@media (max-width: 1200px) {
  .team-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .pitch-surface {
    min-height: 0;
    padding: 16px;
  }

  .pitch-selection-summary,
  .pitch-selection-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pitch-selection-points,
  .pitch-action-button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .pitch-header,
  .team-toolbar,
  .team-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .team-toolbar-actions {
    width: 100%;
  }

  .ghost-button,
  .primary-button {
    width: 100%;
    text-align: center;
  }

  .player-card {
    padding: 12px;
  }

  .player-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-actions {
    width: 100%;
  }

  .chip-button {
    flex: 1 1 auto;
    text-align: center;
  }

  .pitch-line.defenders,
  .pitch-line.midfielders,
  .pitch-line.forwards {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 700px) {
  .lineup-player {
    flex-direction: column;
    align-items: stretch;
  }

  .lineup-actions {
    justify-content: flex-start;
  }

  .lineup-actions > * {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .team-board {
    gap: 16px;
  }

  .pitch-surface {
    padding: 14px;
  }

  .pitch-selection-tray {
    padding: 12px;
  }

  .pitch-line.goalkeeper,
  .pitch-line.defenders,
  .pitch-line.midfielders,
  .pitch-line.forwards {
    grid-template-columns: 1fr !important;
  }

  .player-card,
  .bench-item,
  .summary-item {
    padding: 12px;
  }

  .player-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chip-button {
    width: 100%;
  }

  .formation-pill {
    width: 100%;
    text-align: center;
  }

  .player-card-header,
  .bench-item,
  .summary-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
