:root {
  --bg: #0b0f17;
  --card: #0f172a;
  --card2: #101b33;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, .08);
  --shadow: 0 18px 45px rgba(0, 0, 0, .45);
  --shadow2: 0 10px 25px rgba(0, 0, 0, .35);

  --primary: #22c55e;
  --primary2: #16a34a;
  --danger: #ef4444;
  --warn: #f59e0b;

  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background:
    linear-gradient(180deg,
      #0b0f17 0%,
      #080c13 100%);

  color: var(--text);

  min-height: 100vh;
  background-attachment: fixed;
}

header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 22, .75);
  position: sticky;
  top: 0;
  z-index: 20;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
}

main,
section {
  width: 100%;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

b {
  letter-spacing: .2px;
}

.card {
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow2);
}

.card+.card {
  margin-top: 12px;
}

.tabs {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 22, .55);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 76px;
  z-index: 15;
  overflow-x: auto;
}

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, .06);
}

.tab:active {
  transform: translateY(1px);
}

.tab.active {
  border-color: rgba(34, 197, 94, .45);
  background: linear-gradient(180deg, rgba(34, 197, 94, .22), rgba(34, 197, 94, .10));
  box-shadow: 0 10px 25px rgba(34, 197, 94, .15);
}

input,
select {
  width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, transform .08s ease, background .15s ease;
}

input::placeholder {
  color: rgba(148, 163, 184, .75);
}

input:focus,
select:focus {
  border-color: rgba(34, 197, 94, .45);
  background: rgba(255, 255, 255, .05);
}

button {
  appearance: none;
  border: 1px solid rgba(34, 197, 94, .55);
  background: linear-gradient(180deg, rgba(34, 197, 94, .85), rgba(34, 197, 94, .65));
  color: #05130a;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .2px;
  box-shadow: 0 14px 30px rgba(34, 197, 94, .18);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}

button:hover {
  filter: brightness(1.05);
  box-shadow: 0 18px 40px rgba(34, 197, 94, .22);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(255, 255, 255, .06);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  font-size: 12px;
  font-weight: 800;
}

.link {
  color: #60a5fa;
  cursor: pointer;
  font-weight: 800;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
}

.player-item input {
  width: 100%;
  min-width: 160px;
}

.player-item .right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: left;
  font-size: 14px;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(148, 163, 184, .95);
  background: rgba(255, 255, 255, .03);
}

.table tr:hover td {
  background: rgba(255, 255, 255, .03);
}

pre {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
}

#authBox {
  margin-bottom: 16px;
}

#loginForm {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

#logoutBox {
  display: none;
}

#authStatus {
  min-width: 220px;
}

#authBox input {
  min-width: 180px;
}

#tab-jogos,
#tab-ranking,
#tab-jogadores,
#tab-dados {
  width: 100%;
}

/* ===== mobile ===== */
@media (max-width: 720px) {
  header {
    position: static;
  }

  .tabs {
    top: 0;
    position: static;
  }

  input,
  select,
  button {
    width: 100%;
  }
}

/* ===== auth / visitante ===== */
#authBox .row {
  width: 100%;
}

#loginForm {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

#loginForm>div {
  display: flex;
  flex-direction: column;
}

#loginForm .auth-actions {
  flex-direction: row;
  align-items: end;
  gap: 10px;
}

#authStatus {
  min-width: 220px;
}

#authBox input {
  min-width: 180px;
}

.guest-badge {
  color: #facc15;
  font-weight: 800;
}

@media (max-width: 720px) {
  #loginForm {
    width: 100%;
  }

  #loginForm>div,
  #loginForm .auth-actions {
    width: 100%;
  }

  #loginForm .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== cadastro ===== */

.register-form {
  width: 100%;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.register-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

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

.register-grid>div {
  min-width: 0;
}

.register-grid input {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.whatsapp-input {
  display: flex;
  width: 100%;
}

.whatsapp-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 10px 12px;

  border: 1px solid var(--border);
  border-right: 0;

  border-radius: 14px 0 0 14px;

  background: rgba(255, 255, 255, .06);

  color: var(--text);
  font-weight: 850;
}

.whatsapp-input input {
  flex: 1;
  min-width: 0;
  margin-top: 0;

  border-radius: 0 14px 14px 0;
}

.register-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

#registerStatus {
  min-height: 20px;
  margin-top: 12px;
}

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

  .register-actions {
    flex-direction: column;
  }

  .whatsapp-prefix {
    width: 58px;
    min-width: 58px;
  }

  .whatsapp-input input {
    width: calc(100% - 58px);
  }
}

/* ===== CARD IMAGEM RESENHA ===== */

.summary-share-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, .88);
  backdrop-filter: blur(8px);
}

.summary-share-modal.is-visible {
  display: flex;
}

.summary-share-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #0b1220;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.summary-share-dialog-header,
.summary-share-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-share-dialog-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary-share-close {
  width: 42px;
  min-width: 42px;
}

.summary-share-preview-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #020617;
}

.summary-share-preview {
  display: block;
  width: 100%;
  height: auto;
}

.summary-share-dialog-actions {
  margin-top: 14px;
}

.summary-share-dialog-actions button:first-child {
  flex: 1;
}

.summary-share-dialog-actions button:last-child {
  width: auto;
}

.summary-capture-card {
  position: fixed;
  top: 0;
  left: -12000px;
  width: 1080px;
  min-height: 1350px;
  overflow: hidden;
  padding: 72px;
  color: #fff;
  background:
    radial-gradient(700px 500px at 10% 0%, rgba(34, 197, 94, .26), transparent 70%),
    radial-gradient(600px 500px at 100% 100%, rgba(239, 68, 68, .18), transparent 70%),
    linear-gradient(150deg, #020617 0%, #0b1220 48%, #111827 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.summary-capture-glow {
  position: absolute;
  inset: 0;
  border: 18px solid rgba(255, 255, 255, .035);
  pointer-events: none;
}

.summary-capture-content {
  position: relative;
  z-index: 1;
}

.summary-capture-brand {
  color: #86efac;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 8px;
}

.summary-capture-eyebrow {
  margin-top: 42px;
  color: #94a3b8;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 5px;
}

.summary-capture-title {
  margin-top: 12px;
  font-size: 58px;
  font-weight: 950;
  line-height: 1.06;
}

.summary-capture-period {
  margin-top: 16px;
  color: #cbd5e1;
  font-size: 25px;
}

.summary-capture-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.summary-capture-stats>div {
  padding: 24px;
  border: 2px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: rgba(255, 255, 255, .045);
}

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

.summary-capture-stats strong {
  font-size: 42px;
}

.summary-capture-stats span {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
}

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

.summary-capture-highlight {
  min-width: 0;
  padding: 28px;
  border: 2px solid;
  border-radius: 26px;
}

.summary-capture-highlight.is-winner {
  border-color: rgba(250, 204, 21, .42);
  background: linear-gradient(145deg, rgba(250, 204, 21, .15), rgba(22, 163, 74, .1));
}

.summary-capture-highlight.is-loser {
  border-color: rgba(248, 113, 113, .36);
  background: linear-gradient(145deg, rgba(248, 113, 113, .14), rgba(127, 29, 29, .1));
}

.summary-capture-highlight-label {
  color: #cbd5e1;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 2px;
}

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

.summary-capture-highlight strong {
  margin-top: 15px;
  font-size: 35px;
  line-height: 1.12;
}

.summary-capture-highlight span {
  margin-top: 11px;
  color: #cbd5e1;
  font-size: 19px;
  line-height: 1.35;
}

.summary-capture-highlight blockquote {
  min-height: 90px;
  margin: 24px 0 0;
  color: #fff;
  font-size: 22px;
  font-style: italic;
  font-weight: 750;
  line-height: 1.35;
}

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

.summary-capture-trend {
  padding: 20px 24px;
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  background: rgba(2, 6, 23, .28);
}

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

.summary-capture-trend span {
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 2px;
}

.summary-capture-trend strong {
  margin-top: 9px;
  font-size: 28px;
}

.summary-capture-trend small {
  margin-top: 7px;
  color: #cbd5e1;
  font-size: 17px;
}

.summary-capture-trend.is-rising span {
  color: #86efac;
}

.summary-capture-trend.is-falling span {
  color: #fca5a5;
}

.summary-capture-ranking {
  margin-top: 26px;
  padding: 26px;
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  background: rgba(2, 6, 23, .32);
}

.summary-capture-ranking-title {
  margin-bottom: 13px;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 4px;
}

.summary-capture-ranking-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 53px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 22px;
}

.summary-capture-ranking-row strong {
  overflow-wrap: anywhere;
}

.summary-capture-ranking-row b {
  color: #86efac;
}

.summary-capture-footer {
  margin-top: 34px;
  color: #64748b;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
}

.share-card {
  position: fixed;
  top: -9999px;
  left: -9999px;

  width: 1080px;
  height: 1920px;

  background-color: #020617;
  /* fundo base forte */

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  /* força branco */
}

.share-card.best {
  background: linear-gradient(180deg,
      #020617 0%,
      #0f172a 40%,
      #14532d 100%);
  color: #facc15;
  /* dourado leve */
}

.share-card.worst {
  background: linear-gradient(180deg,
      #020617 0%,
      #0f172a 40%,
      #7f1d1d 100%);
  color: #f87171;
  /* vermelho suave */
}

.share-title {
  font-size: 52px;
  letter-spacing: 4px;
  opacity: 0.85;
  font-weight: 700;
  color: #ffffff;
}

.share-subtitle {
  font-size: 86px;
  font-weight: 900;
  margin-top: 26px;
  line-height: 1.1;
  color: #ffffff;
}

.share-name {
  font-size: 74px;
  margin-top: 80px;
  font-weight: 900;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.share-stats {
  margin-top: 32px;
  font-size: 42px;
  opacity: 0.95;
  color: #ffffff;
}

.share-msg {
  margin-top: 90px;
  font-size: 50px;
  line-height: 1.35;
  font-style: italic;
  opacity: 0.95;
  max-width: 820px;
  color: #ffffff;
}

.share-date {
  margin-top: 100px;
  font-size: 28px;
  opacity: 0.7;
  letter-spacing: 2px;
  color: #ffffff;
}

.championship-sort-disabled {
  opacity: .45;
  filter: grayscale(.6);
  cursor: not-allowed;
  box-shadow: none;
}

.championship-sort-disabled:hover {
  filter: grayscale(.6);
  box-shadow: none;
}

.bulk-player-row {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.bulk-player-field {
  min-width: 160px;
}

.bulk-player-name {
  flex: 1;
  min-width: 220px;
}

.bulk-player-field input,
.bulk-player-field select {
  width: 100%;
}

.bulk-player-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.bulk-player-row-error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, .08);
}

.btnRemoveBulkPlayerRow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .bulk-player-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-player-field,
  .bulk-player-name {
    width: 100%;
    min-width: 0;
  }

  .bulk-player-actions {
    flex-direction: column;
  }

  .btnRemoveBulkPlayerRow {
    width: 100%;
  }
}

/* ===== ANDAMENTO DA SESSÃO ===== */

.session-progress-card {
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(500px 180px at 50% 0%,
      rgba(34, 197, 94, .11),
      transparent 72%),
    linear-gradient(180deg,
      rgba(255, 255, 255, .055),
      rgba(255, 255, 255, .02));
}

.session-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid rgba(34, 197, 94, .28);
  border-radius: 999px;
  background: rgba(34, 197, 94, .09);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.session-game-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.next-game-display {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(2, 6, 23, .34);
  text-align: center;
}

.next-game-display.is-ready {
  border-color: rgba(34, 197, 94, .24);
  background:
    linear-gradient(180deg,
      rgba(34, 197, 94, .07),
      rgba(2, 6, 23, .3));
}

.next-game-display.is-waiting {
  border-color: rgba(245, 158, 11, .22);
}

.next-game-display.is-finished {
  border-color: rgba(34, 197, 94, .36);
  background: rgba(34, 197, 94, .08);
}

.next-game-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.next-game-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 13px;
}

.next-game-pair {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.next-game-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 50%;
  background: rgba(34, 197, 94, .1);
  color: #86efac;
  font-size: 12px;
  font-weight: 950;
}

.next-game-message {
  margin-top: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.session-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.session-progress-actions button {
  width: auto;
}

@media (max-width: 720px) {
  .session-progress-card {
    padding: 13px;
  }

  .session-progress-header {
    align-items: center;
  }

  .session-mode-badge {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .session-game-progress {
    font-size: 12px;
  }

  .next-game-display {
    margin-top: 12px;
    padding: 16px 12px;
  }

  .next-game-versus {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .next-game-pair {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    font-size: 20px;
  }

  .next-game-vs {
    width: 38px;
    height: 38px;
    margin: 0 auto;
  }

  .session-progress-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .session-progress-actions button {
    width: 100%;
    min-height: 44px;
  }

  .session-progress-actions button:only-child {
    grid-column: 1 / -1;
  }

  #btnUndo {
    grid-column: 1 / -1;
  }
}

/* ===== REGISTRO DE JOGO ===== */

.match-entry-grid {
  display: grid;
  grid-template-columns:
    minmax(190px, 1fr) 82px 42px 82px minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.match-entry-pair select {
  width: 100%;
}

.match-entry-score input {
  width: 100%;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.match-entry-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.match-entry-save button {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .match-entry-card {
    padding: 13px;
  }

  .match-entry-grid {
    grid-template-columns:
      minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 10px;
  }

  .match-entry-pair-a {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .match-entry-score-a {
    grid-column: 1;
    grid-row: 2;
  }

  .match-entry-vs {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .match-entry-score-b {
    grid-column: 3;
    grid-row: 2;
  }

  .match-entry-pair-b {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .match-entry-save {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .match-entry-pair select,
  .match-entry-score input,
  .match-entry-save button {
    width: 100%;
  }

  .match-entry-score input {
    min-height: 48px;
    font-size: 20px;
  }

  .match-entry-vs {
    min-height: 48px;
    padding-bottom: 12px;
  }

  .match-entry-save button {
    min-height: 48px;
    margin-top: 2px;
  }
}

/* ===== HISTÓRICO DA SESSÃO ===== */

#matchHistory {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-history-item {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.match-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-history-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.match-history-edit {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
}

.match-history-scoreboard {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.match-history-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 9px;
}

.match-history-team.is-winner {
  background: rgba(34, 197, 94, .07);
}

.match-history-pair {
  min-width: 0;
  font-size: 14px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.match-history-team.is-winner .match-history-pair,
.match-history-team.is-winner .match-history-score {
  color: #86efac;
}

.match-history-team.is-loser {
  color: var(--muted);
}

.match-history-score {
  text-align: center;
  font-size: 18px;
  font-weight: 950;
}

@media (max-width: 720px) {
  #historyCard {
    padding: 13px;
  }

  .match-history-item {
    padding: 9px 10px;
  }

  .match-history-number {
    font-size: 10px;
  }

  .match-history-edit {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .match-history-scoreboard {
    margin-top: 5px;
  }

  .match-history-team {
    grid-template-columns: minmax(0, 1fr) 38px;
    min-height: 32px;
    padding: 3px 7px;
  }

  .match-history-pair {
    font-size: 13px;
  }

  .match-history-score {
    font-size: 17px;
  }
}

/* ===== MONTAGEM DO RODÍZIO ===== */

.rotation-setup-card {
  overflow: hidden;
}

.rotation-participants-info {
  margin-top: 6px;
  line-height: 1.4;
}

.rotation-match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin-top: 14px;
}

.rotation-pair-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.rotation-pair-title {
  margin-bottom: 10px;
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rotation-pair-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rotation-pair-fields select {
  width: 100%;
}

.rotation-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.rotation-resting-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 12px;
  background: rgba(245, 158, 11, .06);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.rotation-resting-info.is-waiting {
  color: var(--muted);
}

.rotation-resting-label {
  color: #fbbf24;
  font-weight: 900;
}

.rotation-prepare-button {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .rotation-setup-card {
    padding: 13px;
  }

  .rotation-participants-info {
    font-size: 12px;
  }

  .rotation-match-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rotation-pair-card {
    padding: 11px;
  }

  .rotation-pair-fields {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .rotation-vs {
    width: 38px;
    height: 38px;
    margin: 0 auto;
    border: 1px solid rgba(34, 197, 94, .3);
    border-radius: 50%;
    background: rgba(34, 197, 94, .08);
    color: #86efac;
  }

  .rotation-resting-info {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .rotation-prepare-button {
    width: 100%;
    min-height: 48px;
  }
}

/* ===== EXPANDIR / RECOLHER RODÍZIO ===== */

.rotation-setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rotation-toggle-button {
  width: auto;
  flex-shrink: 0;
}

#rotationSetupContent {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .rotation-setup-header {
    flex-direction: column;
    align-items: stretch;
  }

  .rotation-toggle-button {
    width: 100%;
    min-height: 44px;
  }

  #rotationSetupContent {
    margin-top: 10px;
  }
}

/* ===== ABA SESSÕES ===== */

.sessions-list-card {
  overflow: hidden;
}

#sessionsList {
  display: grid;
  gap: 8px;
}

.session-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.session-list-main {
  min-width: 0;
  flex: 1;
}

.session-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-list-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.session-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.session-list-best {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.session-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.session-list-actions button {
  width: auto;
}

.sessions-back-button {
  width: auto;
  margin-bottom: 12px;
}

.session-details-card {
  overflow: hidden;
}

.session-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.session-details-title {
  margin: 4px 0 0;
  font-size: 21px;
}

.session-details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.session-details-share-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 14px;
}

.session-details-share-actions button {
  width: auto;
}

.session-accordion {
  border-top: 1px solid var(--border);
}

.session-accordion:last-child {
  border-bottom: 1px solid var(--border);
}

.session-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

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

.session-accordion summary::after {
  content: "⌄";
  margin-left: 6px;
  color: var(--muted);
  transform: rotate(0deg);
  transition: transform .15s ease;
}

.session-accordion[open] summary::after {
  transform: rotate(180deg);
}

.session-accordion-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.session-accordion-content {
  padding: 0 2px 16px;
}

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

.session-highlight-card {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
}

.session-highlight-card.is-best {
  border-color: rgba(34, 197, 94, .32);
  background: rgba(34, 197, 94, .06);
}

.session-highlight-card.is-worst {
  border-color: rgba(239, 68, 68, .28);
  background: rgba(239, 68, 68, .05);
}

.session-highlight-label {
  font-size: 12px;
  font-weight: 900;
}

.session-highlight-card.is-best .session-highlight-label {
  color: #86efac;
}

.session-highlight-card.is-worst .session-highlight-label {
  color: #fca5a5;
}

.session-highlight-name {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.session-highlight-stats {
  margin-top: 5px;
  font-size: 12px;
}

.session-summary-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.session-summary-description,
.session-pairs-used {
  margin-top: 6px;
  line-height: 1.45;
}

.session-games-list {
  display: grid;
  gap: 8px;
}

.session-game-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
}

.session-game-number {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.session-game-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 31px;
  padding: 3px 7px;
  border-radius: 8px;
}

.session-game-team.is-winner {
  background: rgba(34, 197, 94, .07);
  color: #86efac;
}

.session-game-team.is-loser {
  color: var(--muted);
}

.session-game-team strong {
  text-align: center;
  font-size: 17px;
}

.session-more-button {
  width: 100%;
  margin-top: 10px;
}

.session-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.session-ranking-table {
  min-width: 610px;
}

@media (max-width: 720px) {
  .summary-share-modal {
    padding: 10px;
  }

  .summary-share-dialog {
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .summary-share-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-share-dialog-actions button,
  .summary-share-dialog-actions button:last-child {
    width: 100%;
  }

  .session-list-item {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .session-list-header {
    justify-content: space-between;
  }

  .session-list-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .session-list-actions button {
    width: 100%;
    min-height: 42px;
  }

  .session-list-actions .btnDeleteSession {
    width: 44px;
  }

  .sessions-back-button {
    width: 100%;
    min-height: 44px;
  }

  .session-details-header {
    flex-direction: column;
    gap: 10px;
  }

  .session-details-share-actions button {
    width: 100%;
  }

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

  .session-accordion summary {
    min-height: 48px;
  }

  .session-details-title {
    font-size: 19px;
  }

  .session-game-team {
    grid-template-columns: minmax(0, 1fr) 38px;
  }
}

/* ===== RANKING INDIVIDUAL DA SESSÃO ===== */

.session-individual-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.session-individual-podium-item {
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  text-align: center;
}

.session-individual-position-1 {
  border-color: rgba(250, 204, 21, .38);
  background: rgba(250, 204, 21, .07);
}

.session-individual-position-2 {
  border-color: rgba(203, 213, 225, .28);
  background: rgba(203, 213, 225, .05);
}

.session-individual-position-3 {
  border-color: rgba(251, 146, 60, .3);
  background: rgba(251, 146, 60, .055);
}

.session-individual-medal {
  font-size: 28px;
}

.session-individual-name {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.session-individual-points {
  margin-top: 5px;
  color: #86efac;
  font-size: 17px;
  font-weight: 950;
}

.session-individual-stats {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
}

.session-individual-table {
  min-width: 680px;
}

.session-individual-table tbody tr:first-child td {
  background: rgba(250, 204, 21, .04);
}

@media (max-width: 720px) {
  .session-individual-podium {
    grid-template-columns: 1fr;
  }

  .session-individual-podium-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    text-align: left;
  }

  .session-individual-medal {
    grid-row: 1 / 3;
    font-size: 26px;
    text-align: center;
  }

  .session-individual-name {
    margin-top: 0;
  }

  .session-individual-points {
    margin-top: 0;
    text-align: right;
  }

  .session-individual-stats {
    grid-column: 2 / -1;
    margin-top: 0;
  }
}

/* ===== LOADING GLOBAL COM MIKASA ===== */

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(2, 6, 23, .74);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity .18s ease,
    visibility .18s ease;
}

.global-loading.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.global-loading-box {
  width: min(310px, 90vw);
  padding: 24px 20px 21px;

  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;

  background:
    radial-gradient(220px 120px at 50% 15%,
      rgba(250, 204, 21, .08),
      transparent 75%),
    #0f172a;

  box-shadow:
    0 28px 65px rgba(0, 0, 0, .55);

  text-align: center;
}

.mikasa-loader {
  position: relative;
  width: 110px;
  height: 112px;
  margin: 0 auto;
}

.mikasa-ball-wrap {
  position: absolute;
  top: 0;
  left: 50%;

  width: 72px;
  height: 72px;

  transform: translateX(-50%);

  animation:
    mikasa-bounce .85s ease-in-out infinite;
}

.mikasa-ball {
  display: block;
  width: 72px;
  height: 72px;

  object-fit: cover;
  border-radius: 50%;

  /*
   * Recorta as bordas brancas da imagem.
   * A bola não gira: apenas sobe, desce e comprime.
   */
  clip-path: circle(46% at 50% 50%);

  filter:
    drop-shadow(0 9px 10px rgba(0, 0, 0, .4));
}

.mikasa-shadow {
  position: absolute;
  left: 50%;
  bottom: 6px;

  width: 58px;
  height: 10px;

  border-radius: 50%;

  background: rgba(250, 204, 21, .25);
  box-shadow:
    0 0 17px rgba(250, 204, 21, .18);

  transform: translateX(-50%);

  animation:
    mikasa-shadow-pulse .85s ease-in-out infinite;
}

.global-loading-text {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.3;
}

.global-loading-subtext {
  margin-top: 5px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

/* A bola apenas quica. Não existe rotate nesta animação. */
@keyframes mikasa-bounce {
  0% {
    transform:
      translateX(-50%) translateY(25px) scaleX(1.07) scaleY(.92);
  }

  12% {
    transform:
      translateX(-50%) translateY(25px) scaleX(1.1) scaleY(.88);
  }

  45% {
    transform:
      translateX(-50%) translateY(-23px) scaleX(.98) scaleY(1.02);
  }

  55% {
    transform:
      translateX(-50%) translateY(-25px) scaleX(.98) scaleY(1.02);
  }

  88% {
    transform:
      translateX(-50%) translateY(23px) scaleX(1.03) scaleY(.96);
  }

  100% {
    transform:
      translateX(-50%) translateY(25px) scaleX(1.07) scaleY(.92);
  }
}

@keyframes mikasa-shadow-pulse {

  0%,
  12%,
  100% {
    width: 60px;
    opacity: .8;
  }

  45%,
  55% {
    width: 32px;
    opacity: .25;
  }
}

/* Respeita quem desabilita animações no aparelho */
@media (prefers-reduced-motion: reduce) {

  .mikasa-ball-wrap,
  .mikasa-shadow {
    animation: none;
  }

  .mikasa-ball-wrap {
    transform:
      translateX(-50%) translateY(12px);
  }
}

/* ===== CICLO MENSAL — DASHBOARD INDIVIDUAL ===== */

.cycle-page-heading,
.cycle-list-card,
.cycle-overview-card,
.cycle-ranking-card,
.cycle-sessions-card,
.cycle-management-card {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.cycle-back-button {
  display: block;
  width: auto;
  max-width: 860px;
  margin: 0 auto 12px;
}

.cycle-browser-list {
  display: grid;
  gap: 10px;
}

.cycle-browser-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .025);
}

.cycle-browser-main {
  min-width: 0;
}

.cycle-browser-header,
.cycle-browser-stats,
.cycle-browser-actions {
  display: flex;
  align-items: center;
}

.cycle-browser-header {
  gap: 9px;
  flex-wrap: wrap;
}

.cycle-browser-header strong {
  font-size: 16px;
}

.cycle-browser-period {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.cycle-browser-stats {
  gap: 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.cycle-browser-actions {
  gap: 8px;
  flex: 0 0 auto;
}

.cycle-browser-actions button {
  width: auto;
}

.cycle-status-badge.is-finished {
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(148, 163, 184, .09);
  color: #cbd5e1;
}

.cycle-overview-card {
  background:
    radial-gradient(520px 180px at 85% 0%, rgba(34, 197, 94, .12), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
}

.cycle-overview-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cycle-overview-eyebrow {
  color: #86efac;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cycle-overview-title {
  margin-top: 5px;
  font-size: 25px;
  font-weight: 950;
  line-height: 1.15;
}

.cycle-overview-period {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.cycle-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.cycle-status-badge.is-active {
  border: 1px solid rgba(34, 197, 94, .3);
  background: rgba(34, 197, 94, .1);
  color: #86efac;
}

.cycle-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.cycle-stat-item {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .28);
}

.cycle-stat-item strong,
.cycle-stat-item span {
  display: block;
}

.cycle-stat-item strong {
  font-size: 19px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.cycle-stat-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cycle-stat-leader {
  border-color: rgba(250, 204, 21, .2);
  background: rgba(250, 204, 21, .045);
}

.cycle-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cycle-ranking-list {
  display: grid;
  gap: 8px;
}

.cycle-ranking-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.cycle-ranking-row.is-top-1 {
  border-color: rgba(250, 204, 21, .24);
  background: rgba(250, 204, 21, .05);
}

.cycle-ranking-row.is-top-2,
.cycle-ranking-row.is-top-3 {
  background: rgba(255, 255, 255, .04);
}

.cycle-ranking-position {
  text-align: center;
  font-size: 22px;
  font-weight: 950;
}

.cycle-ranking-player {
  min-width: 0;
}

.cycle-ranking-player strong,
.cycle-ranking-player span,
.cycle-ranking-points strong,
.cycle-ranking-points span {
  display: block;
}

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

.cycle-ranking-player span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.cycle-ranking-points {
  min-width: 54px;
  text-align: right;
}

.cycle-ranking-points strong {
  color: #86efac;
  font-size: 21px;
  font-weight: 950;
}

.cycle-ranking-points span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.cycle-full-ranking,
.cycle-pairs-details {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}

.cycle-full-ranking>summary,
.cycle-pairs-details>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.cycle-full-ranking>summary::-webkit-details-marker,
.cycle-pairs-details>summary::-webkit-details-marker,
.cycle-management-summary::-webkit-details-marker {
  display: none;
}

.cycle-full-ranking>summary::after,
.cycle-pairs-details>summary::after,
.cycle-management-summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform .15s ease;
}

.cycle-full-ranking[open]>summary::after,
.cycle-pairs-details[open]>summary::after,
.cycle-management-card[open]>.cycle-management-summary::after {
  transform: rotate(180deg);
}

.cycle-ranking-table-wrap {
  padding: 0 10px 10px;
  overflow-x: auto;
}

.cycle-session-list {
  display: grid;
  gap: 8px;
}

.cycle-session-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.cycle-session-date strong,
.cycle-session-date span,
.cycle-session-info strong,
.cycle-session-info span {
  display: block;
}

.cycle-session-date strong {
  font-size: 16px;
}

.cycle-session-date span,
.cycle-session-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.cycle-session-info {
  min-width: 0;
}

.cycle-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 5px;
}

.cycle-session-meta span {
  margin-top: 0;
}

.cycle-session-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cycle-session-item button {
  width: auto;
  white-space: nowrap;
}

.cycle-management-card {
  padding: 0;
  overflow: hidden;
}

.cycle-management-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 950;
}

.cycle-management-summary .muted {
  font-size: 12px;
  font-weight: 700;
}

.cycle-management-content {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.cycle-admin-panel,
.cycle-management-section {
  padding-top: 14px;
}

.cycle-admin-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.cycle-admin-grid input {
  width: 100%;
}

.cycle-admin-grid button {
  width: auto;
}

.cycle-danger-actions,
.cycle-pairs-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cycle-danger-actions button,
.cycle-pairs-actions button {
  width: auto;
}

.cycle-history-list {
  display: grid;
  gap: 8px;
}

.cycle-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

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

.cycle-history-actions button {
  width: auto;
  padding: 8px 10px;
}

.cycle-pairs-content {
  padding: 0 12px 12px;
}

.cycle-legacy-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cycle-legacy-pair {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.cycle-legacy-pair span,
.cycle-legacy-pair strong {
  display: block;
}

.cycle-legacy-pair span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.cycle-legacy-pair strong {
  margin-top: 3px;
}

.cycle-empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
}

.cycle-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
  font-size: 25px;
}

.cycle-empty-inline {
  padding: 13px;
  border: 1px dashed rgba(148, 163, 184, .22);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}

.cycle-top-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cycle-share-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.cycle-share-actions button {
  width: auto;
}

.cycle-top-player {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .28);
}

.cycle-top-player.is-first {
  border-color: rgba(250, 204, 21, .3);
  background: rgba(250, 204, 21, .055);
}

.cycle-top-player.is-second {
  border-color: rgba(203, 213, 225, .25);
  background: rgba(203, 213, 225, .045);
}

.cycle-top-player-position {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cycle-top-player strong,
.cycle-top-player span {
  display: block;
}

.cycle-top-player strong {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cycle-top-player span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

/* ===== STATUS DA LIDERANÇA ===== */

.cycle-leadership-status {
  margin-top: 12px;
  color: #fde047;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
}

/* ===== PROGRESSO DO CICLO ===== */

.cycle-progress {
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .24);
}

.cycle-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cycle-progress-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cycle-progress-header strong {
  color: #86efac;
  font-size: 13px;
  font-weight: 950;
}

.cycle-progress-track {
  height: 11px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, .28);
}

.cycle-progress-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg,
      #16a34a,
      #22c55e,
      #86efac);
  box-shadow:
    0 0 14px rgba(34, 197, 94, .32);
  transition: width .35s ease;
}

.cycle-progress-caption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

/* ===========================
   Linha de corte
=========================== */

.cycle-ranking-divider {
  margin: 12px 2px;
  border-top: 1px dashed rgba(255, 255, 255, .18);
}

/* ===== EVOLUÇÃO NO RANKING DO CICLO ===== */

.cycle-ranking-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cycle-ranking-name-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cycle-ranking-movement {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  margin: 0 !important;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1;
}

.cycle-ranking-movement.is-up {
  color: #86efac !important;
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .1);
}

.cycle-ranking-movement.is-stable {
  color: #fde047 !important;
  border-color: rgba(250, 204, 21, .25);
  background: rgba(250, 204, 21, .08);
}

.cycle-ranking-movement.is-down {
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, .28);
  background: rgba(239, 68, 68, .09);
}

@media (max-width: 720px) {
  .cycle-ranking-name-line {
    gap: 6px;
  }

  .cycle-ranking-movement {
    min-width: 27px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px !important;
  }
}

@media (max-width: 720px) {
  .cycle-browser-item {
    align-items: stretch;
    flex-direction: column;
  }

  .cycle-browser-actions {
    width: 100%;
  }

  .cycle-browser-actions .btnViewCycle {
    flex: 1;
  }

  .cycle-overview-main {
    align-items: center;
  }

  .cycle-overview-title {
    font-size: 21px;
  }

  .cycle-ranking-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .cycle-session-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .cycle-session-item button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .cycle-management-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cycle-management-summary .muted {
    display: none;
  }

  .cycle-admin-grid {
    grid-template-columns: 1fr;
  }

  .cycle-admin-grid button,
  .cycle-danger-actions button,
  .cycle-pairs-actions button {
    width: 100%;
  }

  .cycle-danger-actions,
  .cycle-pairs-actions {
    flex-direction: column;
  }

  .cycle-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .cycle-history-actions {
    width: 100%;
    justify-content: space-between;
  }

  .cycle-legacy-pairs {
    grid-template-columns: 1fr;
  }

  .cycle-ranking-cut {
    margin: 14px 0;
    border-top: 2px dashed rgba(255, 255, 255, .12);
  }

  .cycle-top-two {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cycle-share-actions button {
    width: 100%;
  }

  .cycle-top-player {
    padding: 11px 9px;
  }

  .cycle-top-player strong {
    font-size: 16px;
  }

  .cycle-top-player span {
    font-size: 10px;
  }

  .cycle-progress {
    padding: 11px;
  }

  .cycle-progress-track {
    height: 9px;
  }
}

/* ===== ADMINISTRAÇÃO DO GRUPO ===== */

.group-admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.group-access-request-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.group-access-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.group-access-request-user {
  min-width: 0;
}

.group-access-request-user strong {
  display: block;
  font-size: 15px;
}

.group-access-request-user span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.group-access-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.group-access-request-actions button {
  width: auto;
}

.group-access-request-actions .reject {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .10);
  color: #fca5a5;
  box-shadow: none;
}

.group-access-request-actions .reject:hover {
  background: rgba(239, 68, 68, .16);
}

@media (max-width: 720px) {
  .group-access-request-item {
    flex-direction: column;
    align-items: stretch;
  }

  .group-access-request-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .group-access-request-actions button {
    width: 100%;
  }
}

.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.group-member-item {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.group-member-info {
  min-width: 0;
}

.group-member-info strong {
  display: block;
  font-size: 15px;
}

.group-member-info span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.group-member-role {
  width: 150px;
}

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

.group-member-status {
  white-space: nowrap;
}

.group-member-status.is-active {
  color: #86efac;
}

.group-member-status.is-inactive {
  color: #fca5a5;
}

.group-member-actions .deactivate {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .10);
  color: #fca5a5;
  box-shadow: none;
}

.group-member-actions .reactivate {
  border-color: rgba(34, 197, 94, .45);
  background: rgba(34, 197, 94, .10);
  color: #86efac;
  box-shadow: none;
}

@media (max-width: 720px) {
  .group-member-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .group-member-role {
    width: 100%;
  }

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

  .group-member-actions button {
    width: 100%;
  }
}

.admin-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-mode-button {
  width: 100%;
  border-color: var(--border);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  box-shadow: none;
}

.admin-mode-button:hover {
  background: rgba(255, 255, 255, .06);
}

.admin-mode-button.active {
  border-color: rgba(34, 197, 94, .55);
  background:
    linear-gradient(180deg,
      rgba(34, 197, 94, .22),
      rgba(34, 197, 94, .10));
  color: var(--text);
}

@media (max-width: 720px) {
  .admin-mode-switch {
    grid-template-columns: 1fr 1fr;
  }

  .admin-mode-button {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ===== convites de grupo ===== */

.group-invite-search {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.group-invite-search input {
  flex: 1;
  min-width: 240px;
}

.group-invite-search-results,
.group-invites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.group-invite-search-item,
.group-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background:
    rgba(255, 255, 255, .025);
}

.group-invite-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.group-invite-info span {
  color: var(--muted);
  font-size: 13px;
}

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

.group-invite-role {
  width: auto;
  min-width: 145px;
}

.group-invites-panel {
  margin-bottom: 12px;
  border-color:
    rgba(34, 197, 94, .22);
}

#groupInviteSearchStatus {
  margin-top: 10px;
  min-height: 18px;
}

@media (max-width: 720px) {

  .group-invite-search-item,
  .group-invite-item {
    flex-direction: column;
    align-items: stretch;
  }

  .group-invite-actions {
    width: 100%;
  }

  .group-invite-actions select,
  .group-invite-actions button {
    width: 100%;
  }

  .group-invite-search input {
    min-width: 0;
  }
}

/* =========================================================
   HEADER / PERFIL DO USUÁRIO
   ========================================================= */

.header-right-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-user-menu {
  position: relative;
  flex-shrink: 0;
}

.header-user-button {
  position: relative;

  display: flex;
  align-items: center;
  gap: 10px;

  width: auto;
  min-height: 48px;

  padding: 5px 10px 5px 6px;

  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;

  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, .07),
      rgba(255, 255, 255, .025));

  color: var(--text);

  box-shadow:
    0 10px 28px rgba(0, 0, 0, .22);

  cursor: pointer;
}

.header-user-button:hover {
  border-color:
    rgba(34, 197, 94, .40);

  background:
    linear-gradient(180deg,
      rgba(34, 197, 94, .10),
      rgba(255, 255, 255, .04));

  box-shadow:
    0 12px 30px rgba(34, 197, 94, .08);
}

.header-avatar,
.header-dropdown-avatar,
.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 50%;

  background:
    linear-gradient(145deg,
      #34d399,
      #16a34a);

  color: #03150a;

  font-weight: 950;
  letter-spacing: .03em;

  box-shadow:
    0 5px 16px rgba(34, 197, 94, .24);
}

.header-avatar {
  width: 38px;
  height: 38px;

  font-size: 13px;
}

.header-dropdown-avatar {
  width: 46px;
  height: 46px;

  font-size: 15px;
}

.profile-avatar {
  width: 58px;
  height: 58px;

  font-size: 18px;
}

.header-user-meta {
  display: flex;
  flex-direction: column;

  min-width: 0;

  text-align: left;
  line-height: 1.15;
}

.header-user-meta strong {
  max-width: 150px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: var(--text);

  font-size: 13px;
}

.header-user-meta small {
  margin-top: 3px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 750;
}

.header-user-chevron {
  color: var(--muted);

  font-size: 11px;

  transition:
    transform .18s ease;
}

.header-user-button[aria-expanded="true"] .header-user-chevron {
  transform: rotate(180deg);
}

.header-invite-badge {
  position: absolute;
  top: -5px;
  right: -4px;

  align-items: center;
  justify-content: center;

  min-width: 20px;
  height: 20px;

  padding: 0 5px;

  border: 2px solid #0b0f17;
  border-radius: 999px;

  background: var(--danger);
  color: #fff;

  font-size: 10px;
  font-weight: 950;

  box-shadow:
    0 4px 14px rgba(239, 68, 68, .35);
}

/* =========================
   DROPDOWN
   ========================= */

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  z-index: 1000;

  width: 290px;

  padding: 10px;

  border: 1px solid rgba(255, 255, 255, .10);

  border-radius: 18px;

  background:
    rgba(10, 16, 28, .97);

  backdrop-filter: blur(18px);

  box-shadow:
    0 25px 70px rgba(0, 0, 0, .55);
}

.header-user-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 8px;
}

.header-user-dropdown-profile strong {
  display: block;

  max-width: 190px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 14px;
}

.header-user-dropdown-profile .muted {
  margin-top: 3px;

  font-size: 12px;
}

.header-menu-separator {
  height: 1px;

  margin: 8px 4px;

  background:
    rgba(255, 255, 255, .07);
}

button.header-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;

  width: 100%;

  padding: 10px 11px;

  border: 0;
  border-radius: 12px;

  background: transparent;

  color: var(--text);

  box-shadow: none;

  text-align: left;

  font-weight: 750;
}

button.header-menu-item:hover {
  background:
    rgba(255, 255, 255, .06);

  box-shadow: none;
}

button.header-menu-item>span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;

  flex-shrink: 0;

  font-size: 15px;
}

.header-menu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 22px;
  height: 22px;

  margin-left: auto;
  padding: 0 6px;

  border-radius: 999px;

  background:
    rgba(239, 68, 68, .18);

  color: #fca5a5;

  font-size: 10px;
  font-weight: 900;
}

button.header-menu-logout {
  color: #fca5a5;
}

button.header-menu-logout:hover {
  background:
    rgba(239, 68, 68, .10);
}

/* =========================================================
   MODAL DA CONTA
   ========================================================= */

.user-profile-modal {
  position: fixed;
  inset: 0;

  z-index: 10010;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 18px;

  background:
    rgba(2, 6, 23, .82);

  backdrop-filter: blur(9px);
}

.user-profile-modal.is-visible {
  display: flex;
}

.user-profile-dialog {
  width: min(680px, 100%);
  max-height:
    calc(100vh - 36px);

  overflow: auto;

  border: 1px solid rgba(255, 255, 255, .10);

  border-radius: 24px;

  background:
    linear-gradient(180deg,
      #101827,
      #0a101c);

  box-shadow:
    0 30px 90px rgba(0, 0, 0, .60);
}

.user-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 20px;

  border-bottom:
    1px solid var(--border);
}

.user-profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-profile-heading h2 {
  margin: 0;

  font-size: 20px;
}

.user-profile-heading .muted {
  margin-top: 4px;

  font-size: 12px;
}

.user-profile-close {
  width: 42px;
  min-width: 42px;
  height: 42px;

  padding: 0;

  border-radius: 50%;
}

/* =========================
   ABAS
   ========================= */

.user-profile-tabs {
  display: flex;
  gap: 4px;

  padding: 10px 14px 0;
}

button.user-profile-tab {
  flex: 1;

  border: 0;
  border-bottom:
    2px solid transparent;

  border-radius: 10px 10px 0 0;

  background: transparent;

  color: var(--muted);

  box-shadow: none;

  padding: 11px 10px;

  font-size: 12px;
}

button.user-profile-tab:hover {
  background:
    rgba(255, 255, 255, .04);

  box-shadow: none;
}

button.user-profile-tab.active {
  border-bottom-color:
    var(--primary);

  background:
    rgba(34, 197, 94, .06);

  color: #86efac;
}

/* =========================
   CONTEÚDO
   ========================= */

.user-profile-content {
  padding: 20px;
}

.user-profile-panel {
  width: 100%;
}

.profile-form-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.profile-form-grid>div,
.profile-password-grid>div {
  min-width: 0;
}

.profile-form-grid input,
.profile-password-grid input {
  width: 100%;
  min-width: 0;

  margin-top: 5px;
}

.profile-password-grid {
  display: grid;

  grid-template-columns:
    1fr;

  gap: 14px;

  max-width: 440px;
}

.profile-status {
  min-height: 20px;

  margin-top: 14px;

  font-size: 12px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;

  margin-top: 8px;
}

/* =========================
   MEUS GRUPOS
   ========================= */

.profile-groups-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 14px;
}

.profile-groups-heading .muted {
  margin-top: 4px;

  font-size: 12px;
}

.profile-groups-list {
  display: flex;
  flex-direction: column;

  gap: 9px;
}

.profile-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 13px 14px;

  border: 1px solid rgba(255, 255, 255, .07);

  border-radius: 14px;

  background:
    rgba(255, 255, 255, .025);
}

.profile-group-info {
  display: flex;
  flex-direction: column;

  min-width: 0;

  gap: 3px;
}

.profile-group-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 13px;
}

.profile-group-info .muted {
  font-size: 11px;
}

.profile-group-role {
  flex-shrink: 0;

  padding: 5px 9px;

  border: 1px solid rgba(34, 197, 94, .22);

  border-radius: 999px;

  background:
    rgba(34, 197, 94, .08);

  color: #86efac;

  font-size: 10px;
  font-weight: 850;
}

.profile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 5px;

  padding: 26px 14px;

  border: 1px dashed rgba(255, 255, 255, .10);

  border-radius: 14px;

  text-align: center;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 720px) {

  .header-right-area {
    width: 100%;

    justify-content:
      space-between;
  }

  .header-stats {
    width: 100%;

    justify-content:
      space-between;
  }

  .header-stats .pill {
    flex: 1;

    justify-content: center;

    white-space: nowrap;
  }

  .header-user-menu {
    width: 100%;
  }

  .header-user-button {
    width: 100%;

    border-radius: 16px;
  }

  .header-user-meta {
    flex: 1;
  }

  .header-user-dropdown {
    position: absolute;

    left: 0;
    right: 0;

    width: 100%;
  }

  .profile-form-grid {
    grid-template-columns:
      1fr;
  }

  .profile-groups-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-groups-heading button {
    width: 100%;
  }

  .user-profile-dialog {
    max-height:
      calc(100vh - 20px);
  }

  .user-profile-modal {
    padding: 10px;
  }

  .user-profile-header {
    padding: 16px;
  }

  .user-profile-content {
    padding: 16px;
  }

  .user-profile-tabs {
    overflow-x: auto;
  }

  button.user-profile-tab {
    min-width: 105px;
  }

}

/* =========================================================
   PERFIL / FEEDBACK / TOAST
   ========================================================= */

/* ----- Campo readonly ----- */

.profile-field input[readonly] {
  cursor: default;

  border-color: rgba(148, 163, 184, .16);

  background:
    rgba(148, 163, 184, .055);

  color:
    rgba(226, 232, 240, .72);
}

.profile-field input[readonly]:focus {
  border-color:
    rgba(148, 163, 184, .16);

  background:
    rgba(148, 163, 184, .055);
}

.profile-field-hint {
  margin-top: 6px;

  color: var(--muted);

  font-size: 11px;
  line-height: 1.35;
}


/* ----- Críticas de campo ----- */

.profile-field {
  min-width: 0;
}

.profile-field-error {
  min-height: 17px;

  margin-top: 5px;

  color: #fca5a5;

  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}

.profile-field.has-error input {
  border-color:
    rgba(239, 68, 68, .78);

  background:
    rgba(239, 68, 68, .07);

  box-shadow:
    0 0 0 3px rgba(239, 68, 68, .08);
}

.profile-field.has-error input:focus {
  border-color:
    rgba(239, 68, 68, .95);

  background:
    rgba(239, 68, 68, .09);
}


/*
 * O WhatsApp possui prefixo +55 separado,
 * então o erro precisa atingir o conjunto.
 */
.profile-field.has-error .whatsapp-prefix {
  border-color:
    rgba(239, 68, 68, .78);

  background:
    rgba(239, 68, 68, .09);
}

.profile-field.has-error .whatsapp-input input {
  border-color:
    rgba(239, 68, 68, .78);

  background:
    rgba(239, 68, 68, .07);

  box-shadow:
    0 0 0 3px rgba(239, 68, 68, .08);
}


/* ----- Erros gerais do perfil/senha ----- */

.profile-status:not(:empty) {
  padding: 9px 11px;

  border:
    1px solid rgba(239, 68, 68, .24);

  border-radius: 11px;

  background:
    rgba(239, 68, 68, .07);

  color: #fca5a5;

  font-weight: 750;

  line-height: 1.35;
}


/* ----- Toast global ----- */

.app-toast {
  position: fixed;

  right: 22px;
  bottom: 22px;

  z-index: 30000;

  display: flex;
  align-items: center;

  gap: 11px;

  width:
    min(390px, calc(100vw - 32px));

  padding: 13px 15px;

  border:
    1px solid rgba(255, 255, 255, .10);

  border-radius: 15px;

  background:
    rgba(15, 23, 42, .97);

  box-shadow:
    0 20px 55px rgba(0, 0, 0, .48);

  opacity: 0;

  visibility: hidden;

  transform:
    translateY(14px);

  pointer-events: none;

  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility .18s ease;
}

.app-toast.is-visible {
  opacity: 1;

  visibility: visible;

  transform:
    translateY(0);
}

.app-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 30px;
  height: 30px;

  border-radius: 50%;

  font-size: 14px;
  font-weight: 950;
}

.app-toast-message {
  min-width: 0;

  color: var(--text);

  font-size: 13px;
  font-weight: 750;

  line-height: 1.4;
}


/* sucesso */

.app-toast.is-success {
  border-color:
    rgba(34, 197, 94, .30);

  background:
    linear-gradient(135deg,
      rgba(20, 83, 45, .96),
      rgba(15, 23, 42, .98));
}

.app-toast.is-success .app-toast-icon {
  background:
    rgba(34, 197, 94, .18);

  color: #86efac;
}


/* erro */

.app-toast.is-error {
  border-color:
    rgba(239, 68, 68, .35);

  background:
    linear-gradient(135deg,
      rgba(127, 29, 29, .94),
      rgba(15, 23, 42, .98));
}

.app-toast.is-error .app-toast-icon {
  background:
    rgba(239, 68, 68, .18);

  color: #fca5a5;
}


/* aviso */

.app-toast.is-warning {
  border-color:
    rgba(245, 158, 11, .35);

  background:
    linear-gradient(135deg,
      rgba(120, 53, 15, .94),
      rgba(15, 23, 42, .98));
}

.app-toast.is-warning .app-toast-icon {
  background:
    rgba(245, 158, 11, .18);

  color: #fcd34d;
}


/* informação */

.app-toast.is-info {
  border-color:
    rgba(96, 165, 250, .32);

  background:
    linear-gradient(135deg,
      rgba(30, 64, 175, .88),
      rgba(15, 23, 42, .98));
}

.app-toast.is-info .app-toast-icon {
  background:
    rgba(96, 165, 250, .18);

  color: #93c5fd;
}


/* ----- Loading sempre acima dos modais ----- */

.global-loading {
  z-index: 40000;
}


/* ----- Mobile ----- */

@media (max-width: 720px) {

  .app-toast {
    right: 16px;
    bottom: 16px;

    width:
      calc(100vw - 32px);
  }

  .global-loading {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;

    padding: 16px;

    align-items: center;
    justify-content: center;
  }

  .global-loading-box {
    margin: 0 auto;

    width: min(310px,
        calc(100vw - 32px));
  }

}

/* =========================================================
   FASE 2 — SOLICITAÇÃO DE ACESSO / GRUPOS PENDENTES
   ========================================================= */


/* =========================================================
   MODAL DE SOLICITAÇÃO DE ACESSO
   ========================================================= */

.group-access-modal {
  position: fixed;
  inset: 0;

  z-index: 10015;

  display: none;
  align-items: center;
  justify-content: center;

  width: 100%;

  padding: 18px;

  background:
    rgba(2, 6, 23, .84);

  backdrop-filter: blur(9px);
}

.group-access-modal.is-visible {
  display: flex;
}


.group-access-dialog {
  width: min(500px, 100%);

  max-height:
    calc(100vh - 36px);

  overflow: auto;

  border:
    1px solid rgba(255, 255, 255, .10);

  border-radius: 22px;

  background:
    linear-gradient(180deg,
      #101827,
      #0a101c);

  box-shadow:
    0 28px 80px rgba(0, 0, 0, .58);
}


/* ----- Cabeçalho ----- */

.group-access-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  padding: 20px;

  border-bottom:
    1px solid rgba(255, 255, 255, .07);
}

.group-access-header>div {
  min-width: 0;
}

.group-access-header h2 {
  margin: 0;

  color: var(--text);

  font-size: 20px;
  line-height: 1.2;
}

.group-access-header .muted {
  margin-top: 6px;

  font-size: 12px;
  line-height: 1.45;
}


button.group-access-close {
  flex: 0 0 auto;

  width: 40px;
  min-width: 40px;
  height: 40px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  font-size: 15px;
}


/* ----- Conteúdo ----- */

.group-access-content {
  padding: 20px;
}

.group-access-field {
  width: 100%;
}

.group-access-field>.muted {
  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 750;
}

.group-access-field select {
  width: 100%;
}


/* ----- Crítica do select ----- */

.group-access-field-error {
  min-height: 17px;

  margin-top: 6px;

  color: #fca5a5;

  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}

.group-access-field.has-error select {
  border-color:
    rgba(239, 68, 68, .78);

  background:
    rgba(239, 68, 68, .07);

  box-shadow:
    0 0 0 3px rgba(239, 68, 68, .08);
}

.group-access-field.has-error select:focus {
  border-color:
    rgba(239, 68, 68, .95);

  background:
    rgba(239, 68, 68, .09);
}


/* ----- Status dentro do modal ----- */

.group-access-status {
  margin-top: 4px;

  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.group-access-status:empty {
  display: none;
}

.group-access-status.is-warning,
.group-access-status.is-error,
.group-access-status.is-success {
  display: block;

  margin-top: 12px;

  padding: 10px 12px;

  border-radius: 12px;
}


.group-access-status.is-warning {
  border:
    1px solid rgba(245, 158, 11, .25);

  background:
    rgba(245, 158, 11, .075);

  color: #fcd34d;
}


.group-access-status.is-error {
  border:
    1px solid rgba(239, 68, 68, .26);

  background:
    rgba(239, 68, 68, .075);

  color: #fca5a5;
}


.group-access-status.is-success {
  border:
    1px solid rgba(34, 197, 94, .25);

  background:
    rgba(34, 197, 94, .075);

  color: #86efac;
}


/* ----- Rodapé / ações ----- */

.group-access-actions {
  display: flex;
  justify-content: flex-end;

  gap: 10px;

  padding: 16px 20px 20px;

  border-top:
    1px solid rgba(255, 255, 255, .07);
}

.group-access-actions button {
  width: auto;
}

.group-access-actions #btnConfirmGroupAccess {
  min-width: 150px;
}


/* =========================================================
   MEUS GRUPOS — SOLICITAÇÃO PENDENTE
   ========================================================= */

.profile-group-item.is-pending {
  border-color:
    rgba(245, 158, 11, .24);

  background:
    linear-gradient(135deg,
      rgba(245, 158, 11, .07),
      rgba(255, 255, 255, .02));
}


.profile-group-item.is-pending .profile-group-info strong {
  color: #fde68a;
}


.profile-group-pending-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  flex-shrink: 0;

  gap: 4px;
}


.profile-group-pending {
  display: inline-flex;
  align-items: center;

  padding: 5px 9px;

  border:
    1px solid rgba(245, 158, 11, .28);

  border-radius: 999px;

  background:
    rgba(245, 158, 11, .09);

  color: #fcd34d;

  font-size: 10px;
  font-weight: 850;

  white-space: nowrap;
}


.profile-group-pending-meta small {
  font-size: 10px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 720px) {

  .group-access-modal {
    padding: 10px;
  }


  .group-access-dialog {
    max-height:
      calc(100vh - 20px);

    border-radius: 18px;
  }


  .group-access-header {
    padding: 16px;
  }


  .group-access-header h2 {
    font-size: 18px;
  }


  .group-access-content {
    padding: 16px;
  }


  .group-access-actions {
    flex-direction: column;

    padding: 14px 16px 16px;
  }


  .group-access-actions button,
  .group-access-actions #btnConfirmGroupAccess {
    width: 100%;
  }


  button.group-access-close {
    width: 40px;
    min-width: 40px;
  }


  .profile-group-item.is-pending {
    align-items: flex-start;
  }


  .profile-group-pending-meta {
    align-items: flex-end;
  }

}

/* =========================================================
   JOGADORES — NOVA INTERFACE
   ========================================================= */

#tab-jogadores {
  width: 100%;
}


/* ---------- adicionar jogador ---------- */

.players-add-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.players-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.players-section-heading .muted {
  margin-top: 5px;
  font-size: 13px;
}


/* busca */

.player-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.player-search-field {
  min-width: 0;
}

.player-search-field label,
.player-manual-field label {
  display: block;
  margin-bottom: 6px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 750;
}

.player-search-field input {
  width: 100%;
  min-width: 0;
}

.player-search-button {
  min-width: 110px;
}


/* resultados da busca */

.player-user-search-results:empty {
  display: none;
}

.player-user-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* divisor */

.players-add-divider {
  width: 100%;
  height: 1px;

  background:
    rgba(255, 255, 255, .08);
}


/* jogador avulso */

.player-manual-toggle {
  align-self: flex-start;
}

.player-manual-form {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr) minmax(160px, 220px) auto;

  gap: 10px;
  align-items: end;

  padding: 14px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background:
    rgba(255, 255, 255, .025);
}

.player-manual-field {
  min-width: 0;
}

.player-manual-field input,
.player-manual-field select {
  width: 100%;
  min-width: 0;
}

.player-manual-add {
  white-space: nowrap;
}


/* ---------- lista ---------- */

.players-list-card {
  margin-top: 12px;
}

.players-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 14px;
}

.players-count-label {
  margin-top: 5px;
  font-size: 12px;
}

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

.players-bulk-actions button {
  padding: 8px 12px;

  font-size: 12px;

  white-space: nowrap;
}

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


/* =========================================================
   NOVO CARD DE JOGADOR
   ========================================================= */

.player-card {
  position: relative;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr) auto;

  gap: 16px;

  padding: 14px;

  border: 1px solid var(--border);
  border-radius: 16px;

  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, .04),
      rgba(255, 255, 255, .02));

  transition:
    border-color .15s ease,
    background .15s ease;
}

.player-card:hover {
  border-color:
    rgba(255, 255, 255, .14);

  background:
    rgba(255, 255, 255, .045);
}


/* dados principais */

.player-card-main {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 6px;
}

.player-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.player-card-name {
  overflow: hidden;

  font-size: 15px;
  font-weight: 850;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-status-badge {
  display: inline-flex;
  align-items: center;

  padding: 4px 8px;

  border: 1px solid var(--border);
  border-radius: 999px;

  font-size: 10px;
  font-weight: 900;

  text-transform: uppercase;
  letter-spacing: .04em;

  white-space: nowrap;
}

.player-status-badge.is-active {
  color: #86efac;

  border-color:
    rgba(34, 197, 94, .3);

  background:
    rgba(34, 197, 94, .1);
}

.player-status-badge.is-inactive {
  color: var(--muted);

  background:
    rgba(255, 255, 255, .03);
}


/* lado */

.player-card-side {
  color: var(--muted);

  font-size: 12px;
}


/* vínculo */

.player-account-status {
  display: flex;
  align-items: center;

  gap: 6px;

  margin-top: 3px;

  font-size: 12px;
}

.player-account-status.is-linked {
  color: #86efac;
}

.player-account-status.is-manual {
  color: var(--muted);
}

.player-account-username {
  color: #60a5fa;

  font-weight: 750;
}


/* ações */

.player-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 8px;
}

.player-card-actions button {
  padding: 8px 11px;

  font-size: 11px;

  white-space: nowrap;
}

.player-link-account-button {
  border-color:
    rgba(96, 165, 250, .35) !important;

  color: #93c5fd !important;

  background:
    rgba(59, 130, 246, .08) !important;
}

.player-more-button {
  width: 38px !important;
  min-width: 38px;

  padding-left: 0 !important;
  padding-right: 0 !important;

  font-size: 18px !important;
}


/* formulário de edição */

.player-card-edit {
  grid-column: 1 / -1;

  display: grid;

  grid-template-columns:
    minmax(160px, 1fr) minmax(140px, 200px) minmax(120px, 160px) auto;

  gap: 10px;

  padding-top: 14px;

  border-top:
    1px solid var(--border);
}

.player-card-edit input,
.player-card-edit select {
  width: 100%;
  min-width: 0;
}

.player-card-edit-actions {
  display: flex;
  gap: 8px;
}


/* vínculo inline */

.player-link-panel {
  grid-column: 1 / -1;

  padding: 14px;

  border-top:
    1px solid var(--border);
}

.player-link-panel-title {
  margin-bottom: 10px;

  font-size: 12px;
  font-weight: 850;
}

.player-link-search {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr) auto;

  gap: 8px;
}

.player-link-search input {
  width: 100%;
  min-width: 0;
}

.player-link-results {
  display: flex;
  flex-direction: column;

  gap: 8px;

  margin-top: 10px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 720px) {

  #tab-jogadores .card {
    padding: 12px;
  }


  /* busca */

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

  .player-search-button {
    width: 100%;
  }


  /* cadastro avulso */

  .player-manual-toggle {
    width: 100%;
  }

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

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


  /* toolbar */

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

  .players-bulk-actions {
    display: grid;

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

  .players-bulk-actions button {
    width: 100%;
  }


  /* card */

  .player-card {
    grid-template-columns: 1fr;

    gap: 12px;

    padding: 14px;
  }

  .player-card-heading {
    justify-content:
      space-between;
  }

  .player-card-name {
    white-space: normal;
  }

  .player-card-actions {
    display: grid;

    grid-template-columns:
      minmax(0, 1fr) auto;

    width: 100%;
  }

  .player-card-actions button {
    width: 100%;
  }

  .player-card-actions .player-more-button {
    width: 42px !important;
  }


  /* edição */

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

  .player-card-edit input,
  .player-card-edit select,
  .player-card-edit button {
    width: 100%;
  }

  .player-card-edit-actions {
    display: grid;

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


  /* vincular */

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

  .player-link-search button {
    width: 100%;
  }
}

/* =========================================================
   JOGADORES — COMPLEMENTOS DE AÇÕES
   ========================================================= */

.players-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 5px;

  min-height: 120px;

  padding: 24px;

  text-align: center;

  color: var(--muted);
}

.players-empty-state strong {
  color: var(--text);
}


/* menu de ações */

.player-action-menu {
  grid-column: 1 / -1;

  display: flex;
  justify-content: flex-end;

  padding-top: 12px;

  border-top:
    1px solid var(--border);
}

.player-remove-button {
  border-color:
    rgba(239, 68, 68, .35) !important;

  color:
    #fca5a5 !important;

  background:
    rgba(239, 68, 68, .08) !important;
}


/* resultado de busca para vínculo */

.player-link-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  padding: 10px 12px;

  border:
    1px solid var(--border);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, .025);
}

.player-link-result-info {
  display: flex;
  flex-direction: column;

  min-width: 0;

  gap: 2px;
}

.player-link-result-info strong {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-link-result-info span,
.player-link-result-info small {
  color: var(--muted);
}

.player-link-result-item button {
  flex-shrink: 0;

  padding: 8px 11px;

  font-size: 11px;
}


/* melhoria para vínculo visível */

.player-account-status {
  flex-wrap: wrap;
}


/* mobile */

@media (max-width: 720px) {

  .player-link-result-item {
    align-items: stretch;
    flex-direction: column;
  }

  .player-link-result-item button {
    width: 100%;
  }

  .player-action-menu {
    justify-content: stretch;
  }

  .player-action-menu button {
    width: 100%;
  }
}

/* =========================================================
   PERFIL OBRIGATÓRIO
   ========================================================= */

.profile-completion-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  margin-bottom: 18px;
  padding: 14px;

  border:
    1px solid rgba(245, 158, 11, .3);

  border-radius: 14px;

  background:
    rgba(245, 158, 11, .08);
}

.profile-completion-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  min-width: 30px;
  height: 30px;

  border-radius: 50%;

  background:
    rgba(245, 158, 11, .16);

  color: #fbbf24;

  font-weight: 950;
}

.profile-completion-text {
  margin-top: 4px;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.45;
}

.profile-completion-missing {
  margin-top: 8px;

  color: #fbbf24;

  font-size: 12px;
  font-weight: 800;
}

.user-profile-modal.is-profile-required .user-profile-dialog {
  border-color:
    rgba(245, 158, 11, .28);
}

.user-profile-tab:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* =========================================================
   MINHA CONTA / ESTATÍSTICAS
   ========================================================= */

.profile-stats-heading {
  margin-bottom: 16px;
}

.profile-stats-heading strong {
  font-size: 16px;
}

.profile-stats-heading .muted {
  margin-top: 4px;
  font-size: 12px;
}


.profile-stats-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.profile-stats-hero {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 22px 16px;

  border: 1px solid rgba(34, 197, 94, .18);
  border-radius: 18px;

  background:
    linear-gradient(145deg,
      rgba(34, 197, 94, .10),
      rgba(255, 255, 255, .025));
}


.profile-stats-hero-label {
  color: #86efac;

  font-size: 10px;
  font-weight: 900;

  letter-spacing: 1.5px;
}


.profile-stats-main-number {
  margin-top: 4px;

  font-size: 46px;
  line-height: 1;

  font-weight: 950;
}


.profile-stats-main-label {
  margin-top: 7px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;

  letter-spacing: .8px;
}


.profile-stats-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 10px;
}


.profile-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 4px;

  padding: 15px 10px;

  border:
    1px solid rgba(255, 255, 255, .07);

  border-radius: 14px;

  background:
    rgba(255, 255, 255, .025);
}


.profile-stat-card.is-highlight {
  border-color:
    rgba(34, 197, 94, .18);

  background:
    rgba(34, 197, 94, .055);
}


.profile-stat-card strong {
  font-size: 22px;
  line-height: 1.1;
}


.profile-stat-card span {
  color: var(--muted);

  font-size: 10px;
  font-weight: 750;

  text-transform: uppercase;
}


.profile-stats-secondary {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 8px;
}


.profile-stats-secondary>div {
  display: flex;
  flex-direction: column;

  gap: 3px;

  padding: 10px 12px;

  border-radius: 12px;

  background:
    rgba(255, 255, 255, .025);
}


.profile-stats-secondary span {
  color: var(--muted);
  font-size: 10px;
}


.profile-stats-secondary strong {
  font-size: 15px;
}


.profile-stats-groups-title {
  margin-top: 4px;

  font-size: 12px;
  font-weight: 850;

  text-transform: uppercase;

  letter-spacing: .7px;
}


.profile-stats-groups {
  display: flex;
  flex-direction: column;

  gap: 10px;
}


.profile-stat-group {
  padding: 14px;

  border:
    1px solid rgba(255, 255, 255, .07);

  border-radius: 15px;

  background:
    rgba(255, 255, 255, .025);
}

.profile-stat-group {
  position: relative;

  transition:
    transform .12s ease,
    border-color .15s ease,
    background .15s ease,
    opacity .15s ease;
}


.profile-stat-group.is-clickable {
  cursor: pointer;
}


.profile-stat-group.is-clickable:hover {
  transform:
    translateY(-1px);

  border-color:
    rgba(34, 197, 94, .28);

  background:
    rgba(34, 197, 94, .045);
}


.profile-stat-group.is-clickable:active {
  transform:
    translateY(0);
}


.profile-stat-group.is-clickable:focus-visible {
  outline:
    2px solid rgba(34, 197, 94, .55);

  outline-offset: 2px;
}


.profile-stat-group.is-disabled {
  cursor: pointer;

  border-color:
    rgba(148, 163, 184, .10);

  background:
    rgba(148, 163, 184, .035);

  opacity: .58;
}


.profile-stat-group.is-disabled:hover {
  opacity: .72;
}


.profile-stat-group-action {
  display: flex;

  align-items: center;

  gap: 7px;
}


.profile-stat-group-chevron {
  color: var(--muted);

  font-size: 22px;
  line-height: 1;

  transition:
    transform .15s ease,
    color .15s ease;
}


.profile-stat-group.is-clickable:hover .profile-stat-group-chevron {
  color: #86efac;

  transform:
    translateX(2px);
}


.profile-stat-group.is-disabled .profile-stat-group-chevron {
  color:
    rgba(148, 163, 184, .45);
}


.profile-stat-group-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 12px;
}


.profile-stat-group-header strong {
  font-size: 13px;
}


.profile-stat-group-header .muted {
  margin-top: 3px;

  font-size: 10px;
}


.profile-stat-group-status {
  flex-shrink: 0;

  padding: 4px 8px;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 850;

  text-transform: uppercase;
}


.profile-stat-group-status.is-active {
  border:
    1px solid rgba(34, 197, 94, .22);

  background:
    rgba(34, 197, 94, .08);

  color: #86efac;
}


.profile-stat-group-status.is-inactive {
  border:
    1px solid rgba(148, 163, 184, .18);

  background:
    rgba(148, 163, 184, .06);

  color: var(--muted);
}


.profile-stat-group-grid {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 6px;
}


.profile-stat-group-grid>div {
  display: flex;
  flex-direction: column;

  gap: 2px;
}


.profile-stat-group-grid strong {
  font-size: 13px;
}


.profile-stat-group-grid span {
  color: var(--muted);
  font-size: 9px;
}


@media (max-width: 720px) {

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


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


  .profile-stat-group-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 10px;
  }

}

/* =========================================================
   DINÂMICA DOS JOGOS
   ========================================================= */

.match-flow-selector {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.match-flow-heading {
  margin-bottom: 10px;
}

.match-flow-heading strong {
  display: block;
  margin-bottom: 3px;
}

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

.match-flow-option {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
  transition:
    border-color .15s ease,
    background .15s ease,
    transform .08s ease;
}

.match-flow-option:hover {
  background: rgba(255, 255, 255, .045);
}

.match-flow-option.is-selected {
  border-color: rgba(34, 197, 94, .5);
  background:
    linear-gradient(180deg,
      rgba(34, 197, 94, .14),
      rgba(34, 197, 94, .06));
}

.match-flow-option.is-disabled {
  opacity: .55;
}

.match-flow-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.match-flow-label {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 10px;
  cursor: pointer;
}

.match-flow-option.is-disabled .match-flow-label {
  cursor: not-allowed;
}

.match-flow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  font-size: 20px;
}

.match-flow-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.match-flow-copy strong {
  font-size: 14px;
}

.match-flow-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.match-flow-tooltip-wrap {
  position: relative;
  margin-left: 8px;
}

button.match-flow-tooltip-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.match-flow-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 40;

  width: 260px;
  padding: 11px 12px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: #111827;
  color: var(--text);

  box-shadow: var(--shadow2);

  font-size: 12px;
  line-height: 1.45;

  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);

  pointer-events: none;

  transition:
    opacity .15s ease,
    transform .15s ease,
    visibility .15s ease;
}

.match-flow-tooltip-wrap:hover .match-flow-tooltip,
.match-flow-tooltip-wrap:focus-within .match-flow-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.match-flow-disabled-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -19px;

  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

@media (max-width: 720px) {

  .match-flow-options {
    grid-template-columns: 1fr;
  }

  button.match-flow-tooltip-button {
    width: 28px;
  }

  .match-flow-tooltip {
    width: min(260px, calc(100vw - 60px));
  }
}

/* =========================================================
   FTV HUB - IDENTIDADE / HEADER
   ========================================================= */

.header-brand-area {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.header-brand-logo {
  display: block;
  width: 170px;
  max-width: 170px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header-group-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.header-group-area #headerGroupName {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

.header-group-selector {
  max-width: 240px;
}

/* mobile */
@media (max-width: 720px) {

  .header-brand-area {
    width: 100%;
    gap: 10px;
  }

  .header-brand-logo {
    width: 110px;
    max-width: 110px;
  }

  .header-group-area {
    flex: 1;
  }

  .header-group-selector {
    width: 100%;
    max-width: none;
  }
}

/* =========================================================
   MENU DO PERFIL - MOBILE / PWA
   ========================================================= */

@media (max-width: 720px) {

  .header-user-menu {
    width: 100%;
  }

  .header-user-dropdown {
    position: static;

    width: 100%;
    margin-top: 8px;

    padding: 8px;

    border-radius: 16px;

    background:
      linear-gradient(
        180deg,
        rgba(16, 24, 39, .98),
        rgba(10, 16, 28, .98)
      );

    box-shadow:
      0 14px 32px rgba(0, 0, 0, .35);

    backdrop-filter: none;
  }

  .header-user-dropdown-profile {
    display: none;
  }

  button.header-menu-item {
    min-height: 44px;
    padding: 10px 12px;
  }

  .header-menu-separator {
    margin: 5px 4px;
  }
}