:root {
  --bg: #08110d;
  --bg-soft: #0d1712;
  --panel: #101b15;
  --panel-2: #132119;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f7f4;
  --muted: rgba(243, 247, 244, 0.68);
  --green: #2ecc71;
  --green-dark: #1f8f4d;
  --yellow: #f4c542;
  --blue: #2d7ff9;
  --red: #e05858;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 204, 113, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(45, 127, 249, 0.12), transparent 20%),
    linear-gradient(180deg, #07100c 0%, #0b1510 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(8, 17, 13, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.7vw, 2.4rem);
  line-height: 1.04;
  font-weight: 800;
}

.site-description {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.98rem;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, #2fd676 0%, #1ea85a 100%);
  color: #041109;
  box-shadow: 0 12px 24px rgba(46, 204, 113, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: rgba(224, 88, 88, 0.14);
  border-color: rgba(224, 88, 88, 0.3);
  color: #ffd8d8;
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.btn-large {
  min-height: 54px;
  padding: 0 24px;
  font-size: 1rem;
}

.hero-section {
  padding: 34px 0 6px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 18px;
}

.hero-card,
.section-block .container,
.modal-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.022));
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.card-kicker,
.section-kicker {
  margin: 0 0 8px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.countdown-box {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 16px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.countdown-value {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
}

.countdown-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-details {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.detail-value {
  text-align: right;
  font-weight: 700;
}

.venue-address {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.payment-note {
  margin-top: 14px;
  color: var(--yellow);
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 18px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fd676 0%, #f4c542 100%);
  transition: width 0.35s ease;
}

.progress-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-block {
  padding: 14px 0;
}

.section-block .container {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.1vw, 1.8rem);
}

.signup-card {
  padding: 4px 0 0;
}

.join-form,
.admin-form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.94rem;
  color: var(--muted);
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

input:focus {
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.12);
}

.form-feedback {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--yellow);
  line-height: 1.5;
}

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

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

.confirmed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 10px 16px 10px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.confirmed-item--empty {
  opacity: 0.55;
}

.confirmed-avatar-wrap {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.1);
}

.confirmed-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.confirmed-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #9df3bc;
}

/* ── Photo upload area ─────────────────────────────────────── */

.required-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(244, 197, 66, 0.15);
  color: var(--yellow);
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 6px;
}

.photo-upload-area {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.photo-upload-area:hover,
.photo-upload-area:focus-within {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(46, 204, 113, 0.05);
}

.photo-upload-area.has-photo {
  border-style: solid;
  border-color: rgba(46, 204, 113, 0.45);
}

.photo-preview-wrap {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
}

.photo-upload-area.has-photo .photo-preview-wrap {
  display: flex;
}

#photo-canvas {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(46, 204, 113, 0.5);
  display: block;
}

.photo-upload-instructions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
}

.photo-upload-area.has-photo .photo-upload-instructions {
  display: none;
}

.photo-upload-instructions svg {
  color: rgba(255, 255, 255, 0.35);
}

.photo-upload-instructions span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.photo-upload-instructions small {
  font-size: 0.78rem;
  color: var(--muted);
}

.confirmed-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.14);
  color: #9df3bc;
  font-weight: 800;
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.confirmed-name {
  font-weight: 700;
  font-size: 0.92rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-stack {
  display: grid;
  gap: 20px;
}

.sponsor-feature-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.sponsor-feature-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 165px;
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.sponsor-feature-logo {
  width: 100%;
  max-width: 150px;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.sponsor-feature-body {
  display: grid;
  gap: 8px;
}

.sponsor-feature-kicker {
  color: var(--yellow);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sponsor-feature-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.08;
}

.sponsor-feature-subtitle {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.sponsor-feature-description {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.sponsor-feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.team-card {
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  transition: opacity 0.2s;
}

.team-card--bench {
  opacity: 0.6;
  border-style: dashed;
}

.team-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-header--vermelho { background: rgba(231, 76, 60, 0.15); color: #ff7f7f; }
.team-header--amarelo  { background: rgba(241, 196, 15, 0.15); color: #f4c542; }
.team-header--azul     { background: rgba(52, 152, 219, 0.15); color: #7ec8f7; }

.team-card--vermelho { border-color: rgba(231, 76, 60, 0.25); }
.team-card--amarelo  { border-color: rgba(241, 196, 15, 0.25); }
.team-card--azul     { border-color: rgba(52, 152, 219, 0.25); }

.bench-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

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

.team-player-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  width: 16px;
  text-align: right;
  flex: 0 0 auto;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 5, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(180deg, #0d1712 0%, #101b15 100%);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
}

.modal-header {
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.7rem;
}

.modal-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-section h3 {
  margin: 0 0 16px;
  font-size: 1.18rem;
}

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

.field-span-2 {
  grid-column: span 2;
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1 1 260px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

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

.admin-item .name {
  font-weight: 700;
}

.admin-item .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.top-gap {
  margin-top: 12px;
}

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

.captain-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.captain-option input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border-radius: 4px;
  box-shadow: none;
}

.club-logo {
  width: 116px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
  transition: transform 0.2s ease;
}
.club-logo:hover {
  transform: scale(1.06);
}

.club-badge {
  width: 116px;
  height: 140px;
  border-radius: 28px 28px 36px 36px;
  padding: 10px 10px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #0c2016 0%, #133524 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 18px 34px rgba(0,0,0,0.3);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
}

.club-badge-top,
.club-badge-bottom {
  width: 100%;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.club-badge-center {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #2fd676 0%, #15964f 100%);
  color: #041109;
  font-size: 2rem;
  font-weight: 900;
  border: 4px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 24px rgba(46, 204, 113, 0.25);
}

.sponsor-card {
  display: none;
}

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

  .teams-grid {
    grid-template-columns: 1fr;
  }
}

  .teams-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .brand-wrap {
    align-items: flex-start;
  }

  .club-logo {
    width: 88px;
  }

  .club-badge {
    width: 96px;
    height: 118px;
  }

  .club-badge-center {
    width: 58px;
    height: 58px;
    font-size: 1.6rem;
  }

  .confirmed-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid,
  .captains-picker {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  .sponsor-feature-card {
    grid-template-columns: 1fr;
  }

  .sponsor-feature-media {
    min-height: 140px;
  }

  .modal-panel {
    padding: 20px;
  }

  .modal-header-inline,
  .admin-item {
    flex-direction: column;
    align-items: stretch;
  }

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

  .row-actions .btn {
    flex: 1;
    min-width: 80px;
  }
}

@media (max-width: 560px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 20px 16px 32px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(var(--container), calc(100% - 20px));
  }

  .site-header {
    position: static;
  }

  .section-block .container,
  .hero-card {
    padding: 18px;
    border-radius: 20px;
  }

  .countdown-grid {
    gap: 10px;
  }

  .countdown-box {
    padding: 14px 8px;
  }

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

  .header-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    padding: 10px 12px;
    min-height: 42px;
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .ranking-tabs {
    width: 100%;
  }

  .ranking-tab {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }

  .meta-chip {
    font-size: 0.82rem;
    padding: 0 10px;
    min-height: 34px;
  }

  .section-block .container {
    padding: 16px;
  }
}

/* ── Rankings ──────────────────────────────────────────────────────────────── */

.ranking-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ranking-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.ranking-tab.active,
.ranking-tab:hover {
  background: rgba(46,204,113,0.14);
  border-color: rgba(46,204,113,0.4);
  color: var(--green);
}

.ranking-legend {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.ranking-panel.hidden {
  display: none;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.rank-medal {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex: 0 0 auto;
}

.rank-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid rgba(46,204,113,0.3);
}

.rank-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(46,204,113,0.12);
  color: #9df3bc;
  font-weight: 800;
  font-size: 1rem;
  flex: 0 0 auto;
  border: 2px solid rgba(46,204,113,0.3);
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.rank-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  margin: 5px 0 3px;
  overflow: hidden;
}

.rank-bar {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.rank-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--green);
  flex: 0 0 auto;
  min-width: 48px;
  text-align: right;
}

.rank-value--goals {
  color: var(--yellow);
}

/* ── Admin: game results ───────────────────────────────────────────────────── */

.admin-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 4px 0 14px;
}

.gr-teams-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.gr-team-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gr-team-label {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 4px 0;
  border-radius: 6px;
}

.team-vermelho-label { color: #ff7f7f; background: rgba(231,76,60,0.12); }
.team-amarelo-label  { color: #f4c542; background: rgba(241,196,15,0.12); }
.team-azul-label     { color: #7ec8f7; background: rgba(52,152,219,0.12); }

.gr-goals-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.gr-goal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.gr-goal-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(46,204,113,0.3);
}

.gr-goal-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(46,204,113,0.12);
  color: #9df3bc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.gr-goal-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-goal-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.gr-count-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gr-count-btn:hover {
  background: rgba(46,204,113,0.2);
  border-color: var(--green);
}

.gr-count-val {
  font-weight: 800;
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
  color: var(--green);
}

.gr-history {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .gr-teams-grid {
    grid-template-columns: 1fr;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ── Signup tabs ────────────────────────────────────────────────────────────── */

.signup-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.signup-tab {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  flex: 1;
  text-align: center;
}

.signup-tab.active,
.signup-tab:hover {
  background: rgba(46,204,113,0.14);
  border-color: rgba(46,204,113,0.4);
  color: var(--green);
}

.signup-tab-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .signup-tabs {
    flex-direction: column;
  }
}

select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

select:focus {
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.12);
}

select option {
  background: #0f2a1e;
  color: var(--text);
}

/* ── Admin player avatars ─────────────────────────────────────────────────── */

.admin-item-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.admin-player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid rgba(46,204,113,0.3);
}

.admin-player-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(46,204,113,0.12);
  color: #9df3bc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .signup-tabs {
    flex-direction: column;
  }
}

/* ── Brazil Map ──────────────────────────────────────────────────────────── */

.brazil-map-block {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.brazil-map-header {
  margin-bottom: 16px;
}

.brazil-map-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.brazil-map-wrap {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.brazil-map-wrap svg {
  flex: 0 0 auto;
  /* aspect-ratio fallback for Safari < 15 */
  width: min(300px, 90vw);
  height: auto;
  /* Modern: */
  aspect-ratio: 520 / 560;
  /* Fallback height for browsers without aspect-ratio support */
  min-height: 180px;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

.map-state {
  transition: filter 0.2s;
  cursor: default;
}

.map-state--active {
  cursor: pointer;
}

.map-state--active:hover {
  filter: brightness(1.3) saturate(1.2);
}

.map-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.map-legend-code {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
}

.map-legend-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--green);
  background: rgba(46,204,113,0.12);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.map-legend-empty {
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .brazil-map-wrap {
    flex-direction: column;
    align-items: center;
  }
  .map-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0;
  }
}

/* ── Join player confirmed ──────────────────────────────────────────────── */

.join-player-confirmed {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(46, 204, 113, 0.07);
  border: 1px solid rgba(46, 204, 113, 0.25);
}

.join-player-avatar-wrap {
  flex: 0 0 auto;
}

.join-player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(46, 204, 113, 0.4);
}

.join-player-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(46, 204, 113, 0.15);
  color: #9df3bc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
}

.join-player-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -4px;
}

/* ── Player login button (header) ────────────────────────────────────────── */

#player-login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-player-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(46, 204, 113, 0.5);
  flex: 0 0 auto;
}

#player-login-btn.btn-player-active {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(46, 204, 113, 0.08);
  color: var(--text);
}

/* ── Player profile modal ──────────────────────────────────────────────────── */

.player-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(46, 204, 113, 0.07);
  border: 1px solid rgba(46, 204, 113, 0.2);
  margin-bottom: 20px;
}

.pp-avatar-wrap {
  flex: 0 0 auto;
}

.pp-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(46, 204, 113, 0.4);
  display: block;
}

.pp-avatar-fallback {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(46, 204, 113, 0.15);
  color: #9df3bc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
}

.player-profile-info {
  flex: 1;
  min-width: 0;
}

.pp-fullname {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-state-badge {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.player-profile-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#pp-photo-canvas {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CROSS-BROWSER & MOBILE OPTIMISATION PATCH
   Targets: Safari iOS 13+, Chrome Android, Firefox, Samsung Internet
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Form error state */
.field input.field-error,
.field select.field-error {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 0 2px rgba(244,197,66,0.25);
}

#register-feedback,
#join-login-feedback,
#join-feedback {
  font-size: 0.93rem;
  font-weight: 600;
  min-height: 22px;
  /* Always reserve space so feedback appearing doesn't cause layout jump */
  display: block;
  margin-top: 8px;
  border-radius: 10px;
  padding: 0 4px;
  transition: color 0.2s;
}

/* 2. Button tap states — remove 300ms iOS delay everywhere */
* {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"],
label[for],
.photo-upload-area,
.signup-tab,
.ranking-tab {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* 3. Input font size ≥ 16px prevents iOS Safari auto-zoom on focus */
input,
select,
textarea {
  font-size: 16px !important;
}

/* Keep display labels smaller — only the <input> needs the 16px floor */
.field > span,
.field small,
.field-hint {
  font-size: 0.82rem !important;
}

/* 4. Smooth scrolling for iOS */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 5. Safe-area insets (iPhone notch / Dynamic Island) */
.site-header {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left:  env(safe-area-inset-left,  0px);
  padding-right: env(safe-area-inset-right, 0px);
}

footer,
#load-error-banner {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 6. SVG aspect-ratio fallback for Safari < 15 */
.brazil-map-wrap {
  align-items: flex-start;
}

/* Padding-bottom trick as fallback when aspect-ratio unsupported */
@supports not (aspect-ratio: 1) {
  .brazil-map-svg-outer {
    position: relative;
    width: min(300px, 90vw);
    padding-bottom: calc(min(300px, 90vw) * 560 / 520);
    height: 0;
    flex: 0 0 auto;
  }
  .brazil-map-svg-outer svg {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: unset;
  }
}

/* 7. Prevent horizontal scroll on mobile */
body,
.page-shell {
  overflow-x: hidden;
  max-width: 100vw;
}

/* 8. Modal bottom-sheet on small phones */
@media (max-width: 480px) {
  .modal-panel {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 92svh;
    max-height: 92vh; /* fallback */
    width: 100%;
  }

  .modal {
    align-items: flex-end;
  }
}

/* 9. Header actions wrap on very small screens */
@media (max-width: 400px) {
  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 10px;
  }
}

/* 10. Map layout stacks on mobile */
@media (max-width: 520px) {
  .brazil-map-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .brazil-map-wrap svg {
    width: 100% !important;
    max-width: 100%;
  }

  .map-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
}

/* ── Proof upload preview — CSS-controlled, no inline styles needed ───── */
#proof-preview-wrap {
  display: none;
}
.photo-upload-area.has-photo #proof-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
#proof-instructions {
  display: flex;
}
.photo-upload-area.has-photo #proof-instructions {
  display: none;
}

/* ── pp-photo (player profile photo) — same pattern ─────────────────── */
#pp-photo-preview-wrap {
  display: none;
}
.photo-upload-area.has-photo #pp-photo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
#pp-photo-instructions {
  display: flex;
}
.photo-upload-area.has-photo #pp-photo-instructions {
  display: none;
}

/* ── Club logo size on phones ─────────────────────────────────────────── */
@media (max-width: 560px) {
  .club-logo {
    width: 64px !important;
    height: 64px !important;
  }
  .site-title {
    font-size: 1.3rem !important;
  }
  .eyebrow {
    font-size: 0.7rem;
  }
  .site-description {
    font-size: 0.88rem;
  }
}
