:root {
  color-scheme: dark;
  --bg: #07100d;
  --surface: rgba(16, 31, 25, 0.82);
  --surface-strong: #102019;
  --line: rgba(170, 218, 194, 0.13);
  --text: #f2f8f5;
  --muted: #8fa79b;
  --green: #59e39a;
  --green-strong: #25cb79;
  --blue: #72a7ff;
  --red: #ff7c7c;
  --amber: #f8c76a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #10261c 0, transparent 35%),
    linear-gradient(145deg, #060d0a 0%, #07110d 48%, #07100d 100%);
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-a {
  width: 420px;
  height: 420px;
  top: 18%;
  right: -170px;
  background: var(--green);
}

.ambient-b {
  width: 340px;
  height: 340px;
  bottom: -160px;
  left: 14%;
  background: var(--blue);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 46px;
}

.topbar,
.brand,
.status-line,
.panel-heading,
.dialog-actions,
footer {
  display: flex;
  align-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions form {
  margin: 0;
}

.logout-button {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 14, 10, 0.55);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  color: var(--text);
  border-color: rgba(89, 227, 154, 0.28);
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  padding: 38px;
  border: 1px solid rgba(89, 227, 154, 0.22);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(20, 46, 34, 0.92), rgba(10, 24, 18, 0.9)),
    var(--surface);
  box-shadow: var(--shadow);
}

.login-brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(89, 227, 154, 0.4);
  border-radius: 16px;
  color: #06110c;
  background: var(--green);
  box-shadow: 0 0 28px rgba(89, 227, 154, 0.18);
  font-size: 25px;
  font-weight: 950;
}

.login-card h1 {
  margin-bottom: 10px;
  font-size: 28px;
}

.login-copy {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(4, 13, 9, 0.7);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.login-form input:focus {
  border-color: rgba(89, 227, 154, 0.65);
  box-shadow: 0 0 0 3px rgba(89, 227, 154, 0.09);
}

.login-form .run-button {
  margin-top: 4px;
}

.login-error {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 124, 124, 0.25);
  border-radius: 11px;
  color: #ffc0c0;
  background: rgba(90, 29, 29, 0.42);
  font-size: 12px;
}

.login-security {
  margin: 20px 0 0;
  color: #65786e;
  font-size: 10px;
  text-align: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand {
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(89, 227, 154, 0.38);
  border-radius: 14px;
  color: #06110c;
  background: var(--green);
  box-shadow: 0 0 28px rgba(89, 227, 154, 0.22);
  font-weight: 900;
  font-size: 22px;
}

.brand-mark img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

h1 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 14, 10, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(248, 199, 106, 0.1);
}

.live-pill.connected .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(89, 227, 154, 0.1);
}

.tab-nav {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 14, 10, 0.62);
}

.tab-button,
.score-switch {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  transition: 160ms ease;
}

.tab-button:hover,
.score-switch:hover {
  color: var(--text);
}

.tab-button.active,
.score-switch.active {
  color: #06110c;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(37, 203, 121, 0.18);
}

.tab-view {
  animation: view-in 220ms ease;
}

.score-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  min-height: 265px;
  padding: 38px;
  overflow: hidden;
  border: 1px solid rgba(89, 227, 154, 0.2);
  border-radius: 25px;
  background:
    radial-gradient(circle at 90% 20%, rgba(89, 227, 154, 0.16), transparent 30%),
    linear-gradient(110deg, rgba(20, 46, 34, 0.94), rgba(10, 24, 18, 0.8));
  box-shadow: var(--shadow);
}

.live-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.live-score-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64766d;
}

.live-score-dot.live {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 124, 124, 0.1);
  animation: pulse 1.3s infinite;
}

.score-value {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 4px 0 8px;
  font-size: clamp(58px, 10vw, 108px);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.score-value small {
  color: var(--green);
  font-size: 18px;
  letter-spacing: 0;
}

.score-shield-shell {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1px solid rgba(89, 227, 154, 0.28);
  border-radius: 34px;
  color: #06110c;
  background: rgba(89, 227, 154, 0.1);
  box-shadow: inset 0 0 45px rgba(89, 227, 154, 0.08);
  font-size: 54px;
  font-weight: 950;
}

.score-shield-shell img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 17px 0;
}

.score-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.score-card.featured {
  border-color: rgba(89, 227, 154, 0.3);
  background: linear-gradient(145deg, rgba(32, 72, 52, 0.88), var(--surface));
}

.score-card span,
.score-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.score-card span {
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.partial-roster-panel {
  margin-bottom: 17px;
}

.live-lineup-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: stretch;
}

.live-pitch {
  position: relative;
  isolation: isolate;
  min-height: 620px;
  overflow: hidden;
  border: 2px solid rgba(219, 255, 230, 0.34);
  border-radius: 22px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 62px,
      rgba(0, 0, 0, 0.025) 62px,
      rgba(0, 0, 0, 0.025) 124px
    ),
    linear-gradient(155deg, #197843 0%, #126739 48%, #0e5a32 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2);
}

.live-pitch::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(230, 255, 236, 0.42);
  border-radius: 13px;
  content: "";
}

.live-formation-grid {
  display: grid;
  position: absolute;
  inset: 28px 18px;
  grid-template-rows: 1fr 1fr 1fr 0.75fr;
  gap: 2px;
}

.live-pitch-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-evenly;
  gap: 5px;
}

.live-field-player {
  position: relative;
  width: clamp(62px, 8.5vw, 92px);
  min-width: 0;
  color: white;
  text-align: center;
}

.live-field-player.pending {
  opacity: 0.82;
}

.live-field-player.absent,
.live-field-player.substituted {
  opacity: 0.55;
}

.live-field-avatar {
  display: grid;
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto -7px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #092016;
  background: #dcebe3;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  font-weight: 900;
}

.live-field-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.live-field-flag,
.live-field-substitution {
  display: grid;
  position: absolute;
  top: -7px;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 2px solid #155f37;
  border-radius: 50%;
  color: #06110c;
  background: var(--green);
  font-size: 9px;
  font-weight: 950;
}

.live-field-flag {
  right: -7px;
}

.live-field-substitution {
  left: -7px;
  color: white;
  background: var(--red);
}

.live-field-score {
  display: inline-block;
  position: relative;
  z-index: 1;
  min-width: 47px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #062111;
  background: var(--green);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.live-field-player.absent .live-field-score,
.live-field-player.substituted .live-field-score {
  color: #f9dede;
  background: #713636;
}

.live-field-name {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  padding: 4px 5px;
  border-radius: 6px;
  background: rgba(3, 27, 15, 0.82);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-coach-area {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 16, 13, 0.45);
}

.live-coach-area .live-field-player {
  width: 100%;
}

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

.partial-player-grid.reserves {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.partial-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 16, 13, 0.5);
}

.partial-player.pending {
  opacity: 0.72;
}

.partial-player.absent,
.partial-player.substituted {
  opacity: 0.48;
}

.partial-player.substituted-in {
  border-color: rgba(89, 227, 154, 0.55);
  background: rgba(89, 227, 154, 0.1);
  box-shadow: inset 3px 0 var(--green);
}

.partial-player-avatar {
  display: grid;
  position: relative;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: visible;
  border-radius: 50%;
  color: #092016;
  background: #dcebe3;
  font-weight: 900;
}

.partial-player-avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.partial-player-flag {
  display: grid;
  position: absolute;
  top: -5px;
  right: -5px;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #12251c;
  border-radius: 50%;
  color: #06110c;
  background: var(--green);
  font-size: 9px;
}

.partial-player-flag.luxury {
  background: var(--amber);
}

.substitution-icon {
  display: grid;
  position: absolute;
  bottom: -4px;
  left: -5px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #12251c;
  border-radius: 50%;
  color: #06110c;
  background: var(--green);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  font-size: 11px;
  font-weight: 950;
}

.partial-player-identity {
  min-width: 0;
}

.partial-player-identity strong,
.partial-player-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partial-player-identity strong {
  font-size: 12px;
}

.partial-player-identity span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.partial-player-score {
  color: var(--green);
  font-size: 16px;
}

.partial-reserves-shell {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.data-note,
.league-subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.content-placeholder {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.league-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.league-subtitle {
  margin-top: 7px;
}

.league-select-label {
  display: grid;
  gap: 7px;
  min-width: 245px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.league-select-label select {
  min-height: 43px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: #0a1812;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.league-score-switcher {
  display: inline-flex;
  gap: 4px;
  margin: 24px 0 13px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.score-switch {
  min-height: 34px;
  padding: 0 13px;
  font-size: 11px;
}

.league-table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.league-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.league-table th,
.league-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.league-table th {
  color: var(--muted);
  background: rgba(5, 13, 9, 0.55);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-table th:nth-child(2),
.league-table td:nth-child(2) {
  width: 100%;
  text-align: left;
}

.league-table tbody tr:last-child td {
  border-bottom: 0;
}

.league-table tbody tr:hover {
  background: rgba(89, 227, 154, 0.035);
}

.league-table tr.user-team {
  background: rgba(89, 227, 154, 0.08);
  box-shadow: inset 3px 0 var(--green);
}

.rank-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.players-scoring-cell {
  color: var(--blue);
  font-weight: 850;
}

.patrimony-cell {
  color: var(--amber);
  font-weight: 800;
}

.league-team {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 230px;
}

.league-team-shield {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 900;
}

.league-team-shield img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.league-team strong,
.league-team span {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-team strong {
  font-size: 12px;
}

.league-team span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.league-table td.active-score {
  color: var(--green);
  background: rgba(89, 227, 154, 0.04);
  font-weight: 900;
}

.table-placeholder {
  height: 150px;
  color: var(--muted);
  text-align: center !important;
}

.error-copy {
  color: var(--red);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 28px;
  align-items: end;
  padding: 34px;
  border: 1px solid rgba(89, 227, 154, 0.18);
  border-radius: 25px;
  background:
    linear-gradient(110deg, rgba(20, 46, 34, 0.9), rgba(10, 24, 18, 0.78)),
    var(--surface);
  box-shadow: var(--shadow);
}

.next-run {
  margin: 3px 0 7px;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 1;
}

.hero-copy,
.hero-action p,
.card-detail,
dialog p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-action {
  text-align: right;
}

.run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  color: #06110c;
  background: linear-gradient(135deg, #69eda9, #33d482);
  box-shadow: 0 12px 28px rgba(37, 203, 121, 0.2);
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.run-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(37, 203, 121, 0.28);
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.52;
  transform: none;
}

.button-icon {
  font-size: 12px;
}

.hero-action p {
  margin-top: 10px;
  font-size: 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 17px 0;
}

.status-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(15px);
}

.status-card {
  padding: 20px;
  border-radius: 18px;
}

.card-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-line {
  gap: 9px;
}

.status-line strong {
  font-size: 18px;
}

.status-orb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #53625b;
}

.status-orb.good {
  background: var(--green);
  box-shadow: 0 0 14px rgba(89, 227, 154, 0.55);
}

.status-orb.running {
  background: var(--blue);
  box-shadow: 0 0 14px rgba(114, 167, 255, 0.55);
  animation: pulse 1.3s infinite;
}

.status-orb.bad {
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 124, 124, 0.45);
}

.card-detail {
  margin-top: 9px;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.55fr);
  gap: 17px;
}

.panel {
  padding: 24px;
  border-radius: 20px;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 24px;
}

.formation {
  padding: 8px 11px;
  border: 1px solid rgba(114, 167, 255, 0.23);
  border-radius: 10px;
  color: var(--blue);
  background: rgba(114, 167, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.lineup-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(143, 167, 155, 0.2);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.lineup-content {
  display: block;
}

.hidden {
  display: none;
}

.lineup-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.lineup-metric {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 16, 13, 0.45);
}

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

.lineup-metric strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.captain-metric strong {
  color: var(--green);
}

.pitch-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 155px;
  gap: 14px;
  align-items: stretch;
}

.pitch {
  position: relative;
  isolation: isolate;
  min-height: 650px;
  overflow: hidden;
  border: 2px solid rgba(219, 255, 230, 0.34);
  border-radius: 22px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 62px,
      rgba(0, 0, 0, 0.025) 62px,
      rgba(0, 0, 0, 0.025) 124px
    ),
    linear-gradient(155deg, #197843 0%, #126739 48%, #0e5a32 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2);
}

.pitch::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(230, 255, 236, 0.42);
  border-radius: 13px;
  content: "";
}

.pitch-center-line,
.pitch-center-circle,
.pitch-box {
  position: absolute;
  z-index: -1;
  border-color: rgba(230, 255, 236, 0.38);
  pointer-events: none;
}

.pitch-center-line {
  top: 50%;
  right: 12px;
  left: 12px;
  border-top: 1px solid rgba(230, 255, 236, 0.38);
}

.pitch-center-circle {
  top: 50%;
  left: 50%;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(230, 255, 236, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-box {
  left: 50%;
  width: 42%;
  height: 76px;
  border: 1px solid rgba(230, 255, 236, 0.38);
  transform: translateX(-50%);
}

.pitch-box-top {
  top: 12px;
  border-top: 0;
}

.pitch-box-bottom {
  bottom: 12px;
  border-bottom: 0;
}

.formation-grid {
  display: grid;
  position: absolute;
  inset: 25px 18px;
  grid-template-rows: 1fr 1fr 1fr 0.78fr;
  gap: 2px;
}

.pitch-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-evenly;
  gap: 5px;
}

.player-card {
  position: relative;
  width: clamp(58px, 8vw, 86px);
  min-width: 0;
  color: white;
  text-align: center;
}

.player-badge {
  display: grid;
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(5, 28, 16, 0.78);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.3);
}

.player-badge img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.badge-fallback {
  font-size: 11px;
  font-weight: 900;
}

.player-flag {
  display: grid;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #145f36;
  border-radius: 50%;
  color: #062111;
  background: var(--green);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 10px;
  font-weight: 950;
}

.player-name {
  display: block;
  overflow: hidden;
  padding: 5px 5px 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px 7px 3px 3px;
  background: rgba(3, 27, 15, 0.84);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-position {
  display: inline-block;
  min-width: 35px;
  padding: 3px 5px;
  border-radius: 0 0 6px 6px;
  color: #c7f7d8;
  background: rgba(1, 18, 9, 0.82);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.coach-area {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 16, 13, 0.45);
}

.section-label {
  margin: 0 0 11px;
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.coach-area .player-card {
  width: 100%;
}

.coach-area .player-badge {
  width: 56px;
  height: 56px;
}

.bench {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(7, 16, 13, 0.45);
}

.bench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.bench-heading .section-label {
  margin-bottom: 4px;
}

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

.luxury-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.luxury-legend b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #261a00;
  background: var(--amber);
}

.reserve-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.reserve-card {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 30, 22, 0.68);
}

.reserve-card .player-card {
  width: 100%;
}

.reserve-card .player-badge {
  width: 42px;
  height: 42px;
}

.reserve-card .player-badge img {
  width: 33px;
  height: 33px;
}

.reserve-card .player-flag {
  border-color: #162c22;
  color: #261a00;
  background: var(--amber);
}

.schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.schedule-list li:last-child {
  border-bottom: 0;
}

.schedule-day {
  display: grid;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: rgba(89, 227, 154, 0.08);
  font-size: 11px;
  font-weight: 900;
}

.schedule-time strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.schedule-time span,
.schedule-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.log-panel {
  margin-top: 17px;
}

.log-heading {
  margin-bottom: 16px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #d8e7df;
  background: rgba(8, 19, 14, 0.6);
  font-weight: 750;
  cursor: pointer;
}

pre {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(143, 167, 155, 0.1);
  border-radius: 14px;
  color: #a9c5b7;
  background: #050d09;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

footer {
  justify-content: space-between;
  padding: 20px 4px 0;
  color: #65786e;
  font-size: 11px;
}

dialog {
  width: min(470px, calc(100% - 32px));
  padding: 27px;
  border: 1px solid rgba(89, 227, 154, 0.22);
  border-radius: 20px;
  color: var(--text);
  background: #0c1a14;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(1, 5, 3, 0.76);
  backdrop-filter: blur(5px);
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.run-button.compact {
  width: auto;
  min-height: 40px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(390px, calc(100% - 44px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #13251c;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 124, 124, 0.25);
  background: #2a1717;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@media (max-width: 820px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-action {
    text-align: left;
  }

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

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

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

  .pitch-shell {
    grid-template-columns: 1fr;
  }

  .live-lineup-shell {
    grid-template-columns: 1fr;
  }

  .live-coach-area {
    display: block;
  }

  .live-coach-area .live-field-player {
    width: 92px;
  }

  .coach-area {
    display: block;
  }

  .coach-area .player-card {
    width: 92px;
  }

  .pitch {
    min-height: 620px;
  }

  .live-pitch {
    min-height: 590px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .login-body {
    padding: 14px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tab-button {
    padding: 0 8px;
    font-size: 11px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .score-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .score-shield-shell {
    display: none;
  }

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

  .partial-player-grid,
  .partial-player-grid.reserves {
    grid-template-columns: 1fr;
  }

  .league-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .league-select-label {
    min-width: 0;
  }

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

  .pitch {
    min-height: 500px;
  }

  .live-pitch {
    min-height: 520px;
  }

  .live-formation-grid {
    inset: 22px 8px;
  }

  .live-field-player {
    width: clamp(58px, 19vw, 72px);
  }

  .live-field-avatar {
    width: 45px;
    height: 45px;
  }

  .live-field-avatar img {
    width: 41px;
    height: 41px;
  }

  .formation-grid {
    inset: 20px 9px;
  }

  .player-card {
    width: clamp(52px, 17vw, 68px);
  }

  .player-badge {
    width: 40px;
    height: 40px;
  }

  .player-badge img {
    width: 31px;
    height: 31px;
  }

  .player-name {
    font-size: 9px;
  }

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

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

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
