:root {
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #20242d;
  --surface-3: #2a303b;
  --border: rgba(157, 189, 255, .12);
  --text: #edf0f5;
  --muted: #9aa4b2;
  --primary: #9dbdff;
  --primary-2: #4b8eff;
  --green: #35c66b;
  --red: #ef6f6c;
  --yellow: #f0c84b;
  --orange-team: #ff9800;
  --black-team: #111111;
  --red-team: #d32f2f;
  --blue-team: #1976d2;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .18);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1a2330 0, var(--bg) 45%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

input[type="file"] {
  padding: 9px 10px;
}

button {
  cursor: pointer;
}

button:disabled,
.disabled {
  opacity: .4;
  pointer-events: none;
}

a {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.auth-panel {
  width: min(430px, 100%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup h1 {
  margin-bottom: 14px;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex: 0 0 auto;
}

.compact-brand .brand-logo {
  width: 54px;
  height: 54px;
}

.compact-brand h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 40px);
}

.hero-logo {
  width: 86px;
  height: 86px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(32px, 6vw, 56px);
  line-height: .95;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.muted,
.section-title span,
.empty-state p {
  color: var(--muted);
}

.stack,
.grid-form {
  display: grid;
  gap: 12px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.payment-toolbar,
.bulk-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.payment-toolbar .success-btn,
.bulk-actions .primary-btn {
  min-height: 46px;
}

.bulk-actions {
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(140px, auto)) minmax(120px, 1fr);
}

.bulk-actions .muted {
  align-self: center;
  font-weight: 800;
}

.wide,
.wide-panel {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(157, 189, 255, .18);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

input:hover,
select:hover {
  border-color: rgba(157, 189, 255, .32);
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(157, 189, 255, .16);
}

.check-inline {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.check-inline input {
  width: 18px;
  min-height: 18px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.success-btn,
.icon-btn,
.goal-btn {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-weight: 850;
  color: #081018;
  transition: transform .15s var(--ease), filter .15s var(--ease), box-shadow .15s var(--ease);
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.danger-btn:hover:not(:disabled),
.success-btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled),
.goal-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.danger-btn:active:not(:disabled),
.success-btn:active:not(:disabled),
.icon-btn:active:not(:disabled),
.goal-btn:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(.96);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 18px rgba(75, 142, 255, .28);
}

.success-btn {
  background: var(--green);
  color: #06130c;
}

.secondary-btn,
.icon-btn {
  background: var(--surface-3);
  color: var(--text);
}

.file-action {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 14px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.file-action.dragover {
  border-color: var(--green);
  background: rgba(45, 212, 124, .16);
  box-shadow: 0 0 0 3px rgba(45, 212, 124, .16);
}

.file-action input {
  display: none;
}

.danger-btn {
  background: var(--red);
  color: #16090a;
}

.outline {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 111, 108, .55);
}

.full {
  width: 100%;
}

.compact-action {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.danger-panel {
  border: 1px solid rgba(239, 111, 108, .35);
}

.install-box {
  margin-top: 18px;
  color: var(--muted);
}

.install-box summary {
  cursor: pointer;
  font-weight: 800;
}

.install-box form {
  margin-top: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(14px, 4vw, 30px) 10px;
  background: rgba(15, 17, 21, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
}

.tabs {
  position: sticky;
  top: 88px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px clamp(14px, 4vw, 30px) 14px;
  background: rgba(15, 17, 21, .9);
  backdrop-filter: blur(12px);
}

.tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}

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

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #081018;
}

.view {
  display: none;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 16px clamp(14px, 4vw, 30px) 40px;
}

.view.active {
  display: grid;
  gap: 16px;
}

.empty-state {
  min-height: 50vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.timer-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.timer-strip > div {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
}

.timer-strip span,
.mini-label,
.queue-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timer-strip strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(38px, 12vw, 70px);
  line-height: .95;
  font-variant-numeric: tabular-nums;
}

#match-timer {
  color: var(--primary);
}

.timer-action {
  margin-top: 12px;
}

.timer-warning {
  color: var(--red) !important;
  animation: pulse-warning .75s step-end infinite;
}

@keyframes pulse-warning {
  50% {
    opacity: .38;
  }
}

.match-actions,
.moment-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  justify-content: center;
}

.moment-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: none;
}

.match-actions {
  grid-template-columns: 1fr 2fr;
}

.match-actions .play-action,
.match-actions .pause-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  font-size: 16px;
}

.match-actions .pause-action {
  background: var(--yellow);
  color: #171000;
}

.match-actions .finish-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  background: var(--red);
  color: #fff;
}

.button-symbol {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  font-weight: 1000;
  line-height: 1;
}

.player-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.roster-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: 16px;
}

.roster-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.roster-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-chip {
  display: inline-grid;
  gap: 2px;
  min-height: 38px;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
}

.player-chip small {
  font-size: 10px;
  opacity: .86;
}

.black-chip {
  border: 1px solid rgba(255, 255, 255, .42);
  color: #fff !important;
  text-shadow: none;
}

.loan-summary {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-card {
  display: grid;
  gap: 10px;
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
}

.team-card.winner {
  box-shadow: inset 0 0 0 2px var(--green);
}

.team-card.loser {
  opacity: .58;
}

.score-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
}

.score-row strong {
  text-align: center;
  font-size: clamp(56px, 18vw, 100px);
  line-height: .9;
  font-variant-numeric: tabular-nums;
}

.round-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
}

.round-btn.danger {
  background: var(--red);
  color: #16090a;
}

.goal-btn {
  min-height: 64px;
  background: var(--green);
  font-size: 19px;
}

.queue-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  background: var(--surface);
  border-radius: 16px;
}

#queue-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.team-chip,
.status-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.standings-legend {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.status-chip {
  background: var(--surface-3);
  color: var(--text);
}

.type-chip {
  min-height: 22px;
  padding: 3px 8px;
  vertical-align: middle;
}

.type-chip.mensalista {
  background: rgba(53, 198, 107, .2);
  color: #8af0ad;
}

.type-chip.avulso {
  background: rgba(239, 111, 108, .2);
  color: #ffaaa7;
}

.type-chip.isento {
  background: rgba(157, 189, 255, .18);
  color: var(--primary);
}

.outlined-text {
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, .9),
    1px -1px 0 rgba(255, 255, 255, .9),
    -1px 1px 0 rgba(255, 255, 255, .9),
    1px 1px 0 rgba(255, 255, 255, .9);
}

.status-chip.pago {
  background: rgba(53, 198, 107, .18);
  color: #8af0ad;
}

.status-chip.pendente {
  background: rgba(239, 111, 108, .18);
  color: #ffaaa7;
}

.status-chip.isento {
  background: rgba(157, 189, 255, .18);
  color: var(--primary);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title.compact {
  margin-bottom: 10px;
}

.present-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.present-tools .secondary-btn {
  min-height: 38px;
  padding: 8px 12px;
}

.color-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.color-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.color-picker label,
.check-list label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
  color: var(--text);
}

.color-picker input,
.check-list input {
  width: 18px;
  min-height: 18px;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.team-grid,
.rank-grid,
.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.draw-team {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
}

.draw-team header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.draw-team ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.draw-team li,
.player-check-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 9px;
}

.draw-team li {
  grid-template-columns: auto 1fr auto;
  min-height: 48px;
}

.draw-player-info {
  display: grid;
  gap: 2px;
}

.draw-player-info small {
  display: block;
  color: var(--primary);
  font-size: 12px;
}

.same-previous-player {
  border-radius: 12px;
  padding: 6px;
  background: rgba(239, 111, 108, .16);
  outline: 1px solid rgba(239, 111, 108, .45);
}

.pair-insights {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pair-insights small {
  display: block;
}

.draw-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border-radius: 16px;
}

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

.data-list,
.history-list,
.ranking-list,
.session-list {
  display: grid;
  gap: 8px;
}

.data-row,
.history-row,
.ranking-row,
.session-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 14px;
}

.payment-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.payment-check {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0;
}

.payment-check input {
  width: 18px;
  min-height: 18px;
}

.ranking-row {
  border: 1px solid transparent;
}

.ranking-row[role="button"],
.session-row[role="button"] {
  cursor: pointer;
}

.leader-row {
  border-color: rgba(53, 198, 107, .75);
  background: rgba(53, 198, 107, .16);
}

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

.metric-grid span {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
}

.metric-grid strong {
  font-size: 20px;
}

.metric-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.season-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, .08);
}

.season-card[role="button"] {
  cursor: pointer;
}

.season-card span,
.season-card small {
  display: block;
  color: var(--muted);
}

.season-card strong {
  display: block;
  margin: 2px 0;
}

.modal-metrics {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  margin: 12px 0 16px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  vertical-align: middle;
}

.result-badge.win {
  background: rgba(53, 198, 107, .9);
}

.result-badge.draw {
  background: rgba(241, 190, 72, .95);
  color: #171a21;
}

.result-badge.loss {
  background: rgba(239, 111, 108, .95);
}

.result-badge.neutral {
  background: var(--surface-3);
}

.session-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.session-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.session-team-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
}

.team-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}

.session-match-row {
  grid-template-columns: 1fr;
}

.signup-callout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid rgba(157, 189, 255, .18);
  border-radius: 16px;
  text-align: center;
}

.signup-callout a {
  color: var(--primary);
  font-weight: 900;
}

.payment-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(157, 189, 255, .18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(32, 36, 45, .98), rgba(27, 48, 39, .92));
}

.payment-action-card.paid {
  border-color: rgba(53, 198, 107, .35);
  background: rgba(35, 90, 57, .28);
}

.payment-action-card strong,
.payment-action-card small {
  display: block;
}

.payment-action-card small {
  margin-top: 4px;
  color: var(--muted);
}

.payment-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.payment-action-buttons button {
  min-height: 44px;
}

#public-payments tr[data-payment-player-id] {
  cursor: pointer;
}

#public-payments tr[data-payment-player-id]:hover {
  background: rgba(157, 189, 255, .08);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.person-cell > div {
  min-width: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface-3);
  border: 1px solid rgba(157, 189, 255, .22);
}

.avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.avatar-goalkeeper {
  font-size: 20px;
}

.data-row small,
.history-row small,
.ranking-row small,
.session-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

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

.account-actions select {
  width: min(240px, 100%);
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
}

.small-btn {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 800;
}

.small-btn.danger {
  background: rgba(239, 111, 108, .18);
  color: #ffaaa7;
}

.small-btn.success {
  background: rgba(53, 198, 107, .18);
  color: #8af0ad;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 11, .82);
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
}

.large-modal {
  width: min(860px, 100%);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions > * {
  flex: 1;
}

.loan-modal-grid,
.session-review {
  display: grid;
  gap: 16px;
}

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

.loan-option-list {
  display: grid;
  gap: 8px;
}

.loan-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--surface-3);
  border-radius: 12px;
  background: var(--surface-2);
}

.loan-option input {
  width: 18px;
  min-height: 18px;
}

.loan-option .avatar {
  display: none;
}

.compact-list {
  max-height: 260px;
  overflow: auto;
}

.modal-close {
  float: right;
  min-height: 36px;
}

.modal-person {
  margin-bottom: 16px;
}

.crop-canvas {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  display: block;
  margin: 14px auto;
  border-radius: 14px;
  background: var(--surface-3);
}

.edit-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.option-grid,
.grouped-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.option-grid button,
.grouped-options button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 850;
  text-align: left;
  padding: 12px;
}

.group-title {
  margin: 14px 0 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 120;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  max-width: min(480px, calc(100% - 28px));
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--primary);
  color: #081018;
  font-weight: 850;
  transition: .18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.public-shell {
  padding-bottom: 42px;
}

.public-hero {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 30px clamp(14px, 4vw, 30px) 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.public-hero h1 {
  margin: 0;
}

.month-filter {
  min-width: 180px;
}

.public-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  width: min(560px, 100%);
}

.public-grid {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 16px clamp(14px, 4vw, 30px);
}

.player-account-panel {
  border: 1px solid rgba(157, 189, 255, .12);
}

.player-auth-grid,
.player-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
  gap: 14px;
  align-items: start;
}

.player-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.player-area-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
}

.player-area-tabs button,
.player-area-menu button {
  min-height: 46px;
  border: 1px solid rgba(157, 189, 255, .18);
  border-radius: 14px;
  padding: 9px 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 850;
  text-align: center;
}

.player-area-tabs button.active,
.player-area-menu button.active {
  background: var(--primary);
  color: #081018;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .08) inset;
}

.player-area-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.player-area-menu-toggle {
  display: none;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(157, 189, 255, .18);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}

.player-area-menu-toggle span {
  margin-right: 8px;
}

.player-area-menu {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(157, 189, 255, .14);
  border-radius: 16px;
  background: var(--surface);
}

.player-area-content {
  display: grid;
  gap: 14px;
}

.mini-panel {
  min-height: 100%;
  padding: 14px;
  border: 1px solid rgba(157, 189, 255, .14);
  border-radius: 14px;
  background: var(--surface-2);
}

.account-link-btn {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #06130c;
  text-decoration: none;
  font-weight: 850;
}

.player-metric-grid {
  margin: 12px 0 16px;
}

.player-area-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.player-area-shortcuts button {
  min-height: 70px;
  border: 1px solid rgba(157, 189, 255, .16);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.player-area-shortcuts strong,
.player-area-shortcuts small,
.profile-section-card h3,
.profile-section-card p {
  display: block;
}

.player-area-shortcuts strong {
  font-size: 15px;
  font-weight: 900;
}

.player-area-shortcuts small {
  margin-top: 4px;
  color: var(--muted);
}

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

.profile-section-card {
  padding: 14px;
  border: 1px solid rgba(157, 189, 255, .14);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-section-card:first-child {
  grid-column: 1 / -1;
}

.profile-section-card h3 {
  margin: 0 0 6px;
}

.profile-section-card p {
  margin: 0 0 12px;
}

.player-payment-table table {
  min-width: 720px;
}

.session-match-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.session-match-list > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(157, 189, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  font-weight: 800;
}

.session-match-list small {
  color: var(--muted);
  font-weight: 600;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

tr {
  background: var(--surface-2);
}

tr + tr {
  border-top: 6px solid var(--surface);
}

.leader-row {
  outline: 2px solid rgba(53, 198, 107, .55);
  background: rgba(53, 198, 107, .13);
}

td:first-child,
th:first-child {
  border-radius: 12px 0 0 12px;
}

td:last-child,
th:last-child {
  border-radius: 0 12px 12px 0;
}

.text-link {
  font-weight: 850;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.photo-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 14px;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-3);
}

.photo-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.championship-toolbar,
.board-tools,
.championship-timer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.championship-form {
  margin-top: 16px;
}

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

.compact-list {
  margin-top: 14px;
}

.compact-row {
  align-items: center;
}

.championship-timer {
  grid-template-columns: 1fr repeat(4, auto);
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.championship-timer strong {
  align-self: center;
  font-size: clamp(34px, 8vw, 58px);
  line-height: .95;
  font-variant-numeric: tabular-nums;
}

.event-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(157, 189, 255, .16);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.event-chip.goal {
  background: rgba(53, 198, 107, .18);
  color: #8af0ad;
}

.event-chip.assist {
  background: rgba(75, 142, 255, .2);
  color: #b9d0ff;
}

.event-chip.yellow_card {
  background: rgba(240, 200, 75, .2);
  color: #ffe08a;
}

.event-chip.red_card {
  background: rgba(239, 111, 108, .2);
  color: #ffaaa7;
}

.event-chip button {
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-weight: 900;
}

.champ-match-row {
  align-items: start;
}

.board-tools {
  grid-template-columns: repeat(5, minmax(130px, auto));
  margin-bottom: 12px;
}

.tactic-board {
  position: relative;
  min-height: 560px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 2px solid rgba(237, 240, 245, .5);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, transparent 0 10%, rgba(255,255,255,.34) 10.2% 10.8%, transparent 11%),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.45) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent 0 12%, rgba(255,255,255,.38) 12% 12.4%, transparent 12.4% 87.6%, rgba(255,255,255,.38) 87.6% 88%, transparent 88%),
    linear-gradient(90deg, transparent 0 8%, rgba(255,255,255,.38) 8% 8.4%, transparent 8.4% 91.6%, rgba(255,255,255,.38) 91.6% 92%, transparent 92%),
    linear-gradient(135deg, #208d50, #196f43);
  touch-action: none;
}

.tactic-board::before,
.tactic-board::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 15%;
  height: 34%;
  border: 2px solid rgba(255, 255, 255, .42);
  transform: translateY(-50%);
  pointer-events: none;
}

.tactic-board::before {
  left: -2px;
  border-left: 0;
}

.tactic-board::after {
  right: -2px;
  border-right: 0;
}

#championship-board-canvas,
#championship-board-players {
  position: absolute;
  inset: 0;
}

#championship-board-canvas {
  z-index: 2;
  pointer-events: none;
}

.tactic-board.draw-mode #championship-board-canvas {
  pointer-events: auto;
}

#championship-board-players {
  z-index: 3;
}

.tactic-board.draw-mode #championship-board-players {
  pointer-events: none;
}

.tactic-player {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 170px;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  background: rgba(15, 17, 21, .86);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
  touch-action: none;
}

.tactic-player .avatar {
  width: 31px;
  height: 31px;
}

.tactic-player span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.champ-public-roster,
.champ-public-matches {
  display: grid;
  gap: 10px;
}

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

@media (max-width: 760px) {
  .grid-form,
  .scoreboard,
  .player-card-grid,
  .timer-strip,
  .match-actions,
  .moment-actions,
  .public-hero,
  .public-filters,
  .payment-toolbar,
  .bulk-actions,
  .edit-score-grid,
  .loan-modal-grid,
  .metric-grid,
  .season-grid,
  .championship-grid,
  .championship-toolbar,
  .player-auth-grid,
  .player-account-grid,
  .player-area-tabs,
  .player-area-shortcuts,
  .profile-panel-grid,
  .board-tools,
  .championship-timer {
    grid-template-columns: 1fr;
  }

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

  .payment-action-card {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-action-buttons {
    justify-content: stretch;
  }

  .payment-action-buttons button {
    flex: 1;
  }

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

  .player-area-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .player-area-menu {
    position: static;
    display: none;
  }

  .player-area-shell.menu-open .player-area-menu {
    display: grid;
  }

  .tactic-board {
    min-height: 520px;
    aspect-ratio: 10 / 14;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .tabs {
    top: 78px;
  }

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

  .section-title {
    display: grid;
  }

  .goalkeeper-config,
  .draw-actions {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr auto;
  align-items: center;
  gap: 10px;
}

.bar-chart-label {
  color: var(--muted);
  font-size: .82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-chart-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.bar-chart-value {
  color: var(--text);
  font-weight: 800;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.status-bar {
  display: flex;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  gap: 2px;
}

.status-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06130c;
  font-size: .75rem;
  font-weight: 800;
  min-width: 0;
}

.status-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  font-size: .8rem;
  color: var(--muted);
}

.status-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.goal-reassign-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-reassign-actions select {
  width: auto;
  min-width: 160px;
}

.team-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--team-color, var(--surface-3));
  flex: 0 0 auto;
}

.pending-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.pending-total {
  color: var(--red);
}

.pending-months {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pending-month-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
}

.gated-lock {
  padding: 18px;
  text-align: center;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.signup-intro {
  margin: -6px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.signup-password-group {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 0;
}

.signup-password-group legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.emergency-note {
  margin-top: 10px;
  font-size: .85rem;
  color: var(--muted);
}

.emergency-note a {
  color: var(--muted);
  text-decoration: underline;
}

.public-link-panel {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.public-link-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.public-link-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: .85rem;
}

/* Pelada ao vivo (link público) */
.live-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(239, 111, 108, .16);
  color: var(--red);
  font-weight: 700;
  font-size: .85rem;
}

.live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.4s ease-in-out infinite;
}

.live-badge-finished {
  background: rgba(157, 189, 255, .16);
  color: var(--primary);
}

.live-badge-finished::before {
  animation: none;
  background: var(--primary);
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.75); }
}

.live-timer-panel .live-timer-strip {
  justify-content: center;
  text-align: center;
}

.live-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.live-team-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 4px solid var(--team-color, var(--surface-3));
}

.live-team-label {
  font-weight: 700;
  color: var(--team-color, var(--text));
  text-align: center;
}

.live-team-score {
  font-size: 2.4rem;
}

.live-score-sep {
  color: var(--muted);
  font-size: 1.4rem;
}

.live-champion {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--team-color, var(--primary));
}

.live-goals-timeline,
.live-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-goal-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
}

.live-goal-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.live-goal-team {
  color: var(--team-color, var(--muted));
  font-weight: 600;
  font-size: .85rem;
}

.live-queue {
  flex-direction: row;
  flex-wrap: wrap;
}

.live-queue-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--team-color, var(--surface-3));
  color: var(--team-color, var(--text));
  font-weight: 600;
  font-size: .85rem;
}

.live-final-banner {
  text-align: center;
}

@media (max-width: 760px) {
  /* Cadastros: no celular os botões vão para baixo do nome, sem espremer o texto. */
  #view-applications .data-row {
    grid-template-columns: 1fr;
  }
}
