/* 
   Soccer Manager - Dark Premium CSS Stylesheet
   Features: Glassmorphism, HSL color palette, smooth transitions, responsive layout, soccer pitch styling
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg-primary: hsl(222, 47%, 8%);
  --bg-secondary: hsl(222, 47%, 12%);
  --bg-card: hsla(223, 47%, 16%, 0.6);
  --bg-card-hover: hsla(223, 47%, 22%, 0.8);
  --border-color: hsla(217, 32%, 60%, 0.15);
  --border-focus: hsla(142, 71%, 45%, 0.5);
  
  /* Accent Colors */
  --accent-green: hsl(142, 71%, 45%);
  --accent-green-hover: hsl(142, 71%, 38%);
  --accent-blue: hsl(217, 91%, 60%);
  --accent-blue-hover: hsl(217, 91%, 52%);
  --accent-amber: hsl(38, 92%, 50%);
  --accent-rose: hsl(349, 89%, 60%);
  
  /* Text Colors */
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 16%, 47%);
  
  /* Fonts */
  --font-family: 'Outfit', sans-serif;
  
  /* Layout & Animations */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(12px);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, hsla(217, 91%, 60%, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(142, 71%, 45%, 0.08) 0px, transparent 50%);
  min-height: 100vh;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
}

.login-logo-container {
  justify-content: center;
  margin-bottom: 0.5rem;
}

.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.brand-logo-sidebar {
  width: 100%;
  max-width: 224px;
}

.brand-logo-login {
  width: min(100%, 310px);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.nav-item a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active a {
  background: linear-gradient(135deg, hsla(142, 71%, 45%, 0.15), hsla(217, 91%, 60%, 0.05));
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.settings-nav {
  margin-top: auto;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0; /* impede tabelas largas de esticarem a página */
  margin-left: 280px;
  padding: 2.5rem;
  min-height: 100vh;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header UI */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.view-title h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.view-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Cards & Glassmorphism */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: hsla(217, 32%, 60%, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-family);
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-green);
  color: #000;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: var(--accent-green-hover);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-secondary);
}

.btn-accent {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-accent:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-danger {
  background: var(--accent-rose);
  color: #fff;
}

.btn-danger:hover {
  background: hsl(349, 89%, 50%);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-goleiro { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-defensor { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-meio { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-atacante { background: rgba(168, 85, 247, 0.15); color: hsl(270, 89%, 75%); border: 1px solid rgba(168, 85, 247, 0.3); }

.badge-mensalista { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.badge-diarista { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }

.badge-receita { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-despesa { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

/* Dashboard UI Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.stat-details h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-details p {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.quick-match-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
}

.quick-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.quick-match-body {
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-match-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.quick-match-info i {
  color: var(--accent-green);
  width: 18px;
}

/* Athletes View Styles */
.athletes-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-input-wrapper i {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.filter-select {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--accent-green);
}

.athletes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.athlete-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.athlete-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.athlete-shirt-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsla(217, 91%, 60%, 0.1), hsla(142, 71%, 45%, 0.1));
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.athlete-card:hover .athlete-shirt-num {
  border-color: var(--accent-green);
  border-style: solid;
  transform: scale(1.05);
}

.athlete-card-info {
  flex: 1;
}

.athlete-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.athlete-card-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.athlete-card-skill {
  margin-top: 0.5rem;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.skill-progress-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 50px;
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 50px;
  transition: width 1s ease-in-out;
}

.athlete-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* Modals */
html.modal-open,
body.modal-open {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overscroll-behavior: contain;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}

/* Matches Grid */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.match-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-date-badge {
  background: var(--bg-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
}

.match-date-badge i {
  color: var(--accent-green);
}

.match-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-location {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-location i {
  color: var(--accent-rose);
}

.match-details-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
}

.match-placar {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  border: 1px solid var(--border-color);
}

.placar-team {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.match-mvp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.09);
  text-align: left;
}

.match-mvp > i {
  color: var(--accent-amber);
  font-size: 1.35rem;
}

.match-mvp div {
  display: grid;
  line-height: 1.2;
}

.match-mvp span {
  color: var(--accent-amber);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.match-mvp strong { font-size: 0.95rem; }
.match-mvp small { margin-top: 0.15rem; color: var(--text-secondary); font-size: 0.72rem; }

.match-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Match Detail view stylesheet */
.match-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .match-detail-grid {
    grid-template-columns: 1fr;
  }
}

.match-players-selection {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.match-players-selection::-webkit-scrollbar {
  width: 6px;
}

.match-players-selection::-webkit-scrollbar-track {
  background: transparent;
}

.match-players-selection::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.player-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.player-select-row:hover {
  border-color: var(--border-focus);
}

.player-select-row.confirmed {
  background: linear-gradient(90deg, hsla(142, 71%, 45%, 0.08), transparent);
  border-color: hsla(142, 71%, 45%, 0.3);
}

.player-info-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Custom checkbox wrapper */
.custom-checkbox {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
}

.custom-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.custom-checkbox .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Soccer Pitch representation */
.soccer-field {
  background: linear-gradient(180deg, #115e59 0%, #064e3b 100%);
  border-radius: var(--radius-md);
  border: 4px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Field lines decoration */
.soccer-field::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  border-left: 2px dashed rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.soccer-field::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.team-list-container {
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .team-list-container {
    grid-template-columns: 1fr;
  }
}

.team-block {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 2px dashed rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
}

.team-block.drag-over {
  border-color: var(--accent-green) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.team-block-title {
  font-weight: 800;
  font-size: 1.1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-block-title span.skill-sum {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: none;
}

.team-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 150px; /* Garante área mínima para drop mesmo sem jogadores */
}

.pitch-player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: grab;
  user-select: none;
  transition: var(--transition);
}

.pitch-player-item:active {
  cursor: grabbing;
}

.pitch-player-item.dragging {
  opacity: 0.4;
  border-color: var(--accent-blue);
  transform: scale(0.96);
}

.pitch-player-num {
  font-weight: 800;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pitch-player-name {
  font-weight: 500;
  font-size: 0.9rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Team formations shown below the original draw result */
.formations-section {
  margin-top: 1.5rem;
}

.formations-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
}

.formations-title i {
  color: var(--accent-green);
}

.formations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.formation-card {
  --formation-team-color: #2563eb;
  --formation-team-ink: #fff;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
}

.formation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 3px solid var(--formation-team-color);
}

.formation-team-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.75rem;
}

.formation-team-identity > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.formation-team-identity strong {
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.formation-team-identity span {
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.formation-emblem,
.formation-emblem-fallback {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 2px solid color-mix(in srgb, var(--formation-team-color) 70%, white);
  border-radius: 50%;
}

.formation-emblem {
  display: none;
  object-fit: cover;
}

.formation-emblem-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--formation-team-color);
  color: var(--formation-team-ink);
}

.formation-color-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--formation-team-color);
  box-shadow: 0 0 0 2px var(--border-color);
}

.formation-pitch {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: repeating-linear-gradient(
    180deg,
    #245c3c 0,
    #245c3c 52px,
    #1d5034 52px,
    #1d5034 104px
  );
}

.formation-pitch::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  pointer-events: none;
}

.formation-pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.formation-field-markings::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.formation-field-markings::after {
  content: '';
  position: absolute;
  z-index: 1;
  bottom: 10px;
  left: 50%;
  width: 55%;
  height: 70px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 0;
  transform: translateX(-50%);
}

.formation-lines {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 500px;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.6rem;
  padding: 1.1rem 0.5rem;
}

.formation-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-evenly;
  gap: 0.25rem;
  width: 100%;
}

.formation-player {
  display: flex;
  min-width: 0;
  width: 74px;
  flex: 0 1 74px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.formation-player-shirt {
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: var(--formation-team-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  color: var(--formation-team-ink);
  font-size: 1.1rem;
  font-weight: 900;
}

.formation-player-name {
  display: block;
  overflow: hidden;
  width: 100%;
  margin-top: 0.3rem;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.formation-player-position {
  margin-top: 0.2rem;
  padding: 0.08rem 0.3rem;
  font-size: 0.55rem;
  line-height: 1.2;
}

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

@media (max-width: 480px) {
  .formation-pitch,
  .formation-lines {
    min-height: 440px;
  }

  .formation-player {
    width: 64px;
    flex-basis: 64px;
  }

  .formation-player-shirt {
    width: 48px;
    height: 48px;
  }
}

/* Match Stats Form */
.stat-player-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
}

.stat-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.stat-counter span {
  width: 24px;
  text-align: center;
  font-weight: 700;
}

/* Finances Layout */
.finances-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.monthly-grid-card {
  margin-bottom: 1.5rem;
}

.monthly-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.monthly-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.monthly-player-row.paid {
  border-color: hsla(142, 71%, 45%, 0.3);
  background: linear-gradient(90deg, hsla(142, 71%, 45%, 0.05), transparent);
}

.transactions-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tx-table th {
  background: var(--bg-secondary);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.tx-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.tx-table tr:last-child td {
  border-bottom: none;
}

.tx-amount {
  font-weight: 700;
}

.tx-amount.receita { color: var(--accent-green); }
.tx-amount.despesa { color: var(--accent-rose); }

/* Ranking View Styles */
.ranking-table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
  overscroll-behavior: contain;
}

.ranking-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  text-align: left;
}

.ranking-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-secondary);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.ranking-table th:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.ranking-table th i {
  margin-left: 0.25rem;
  font-size: 0.8rem;
}

.ranking-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.ranking-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ranking-position-col {
  font-weight: 700;
  width: 60px;
  text-align: center;
}

.rank-1 { color: #f59e0b; font-size: 1.25rem; }
.rank-2 { color: #94a3b8; font-size: 1.15rem; }
.rank-3 { color: #b45309; font-size: 1.05rem; }

.rank-points {
  color: var(--accent-green);
  font-size: 1.05rem !important;
  font-weight: 800;
}

.rank-player-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rank-player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Alert Boxes */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.alert-box.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: hsl(217, 91%, 85%);
}

.alert-box i {
  font-size: 1.25rem;
  margin-top: 0.1rem;
}

/* Mobile Responsiveness styling */
.mobile-nav-bar {
  display: none;
}

@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    display: none; /* Hide sidebar on mobile */
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem 5.5rem 1rem; /* Pad bottom for mobile bottom nav */
  }
  
  .mobile-nav-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.75rem 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
  }
  
  .mobile-nav-item {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
  }
  
  .mobile-nav-item i {
    font-size: 1.35rem;
  }
  
  .mobile-nav-item.active {
    color: var(--accent-green);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .finalize-split-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

/* Login Screen Styles */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, var(--bg-card) 0%, var(--bg-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.login-card {
  border: 1px solid var(--border-focus) !important;
}

/* Match controls introduced for optional daily fees and in-game team changes */
.player-select-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.player-skill-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.daily-fee-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.daily-fee-toggle.is-busy {
  opacity: 0.6;
  cursor: progress;
}

.daily-fee-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}

.daily-fee-toggle.is-paid span {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--accent-green);
}

.daily-fee-toggle:focus-visible span {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.match-stat-row {
  display: block;
  padding: 0.75rem;
}

.match-stat-player-header,
.match-stat-player-name,
.match-stat-counters {
  display: flex;
  align-items: center;
}

.match-stat-player-header {
  justify-content: space-between;
  gap: 0.75rem;
}

.match-stat-player-name {
  min-width: 0;
  gap: 0.5rem;
}

.match-stat-player-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-team-btn {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
}

.stat-team-history {
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.match-stat-counters {
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-color);
}

.match-stat-counters .stat-counter {
  justify-content: flex-start;
  gap: 0.35rem;
}

.match-stat-counters label {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.match-stat-counters .btn-icon {
  width: 26px;
  height: 26px;
  padding: 0.2rem;
}


/* Finalize Match Scoreboard & Quick Action Controls */
.finalize-scoreboard-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.finalize-team-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

.finalize-team-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.scoreboard-score-input {
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  height: 60px;
  width: 100%;
  max-width: 130px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: var(--transition);
}

.scoreboard-score-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.scoreboard-vs-divider {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-muted);
  user-select: none;
  padding: 0 0.25rem;
}

.team-stat-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.btn-action-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  max-width: 130px;
  white-space: nowrap;
}

.btn-action-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-stat-goal {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #fef08a;
}

.btn-stat-goal:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: #fff;
}

.btn-stat-goal i {
  color: var(--accent-amber);
  font-size: 0.95rem;
}

.btn-stat-assist {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #bfdbfe;
}

.btn-stat-assist:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #fff;
}

.btn-stat-assist i {
  color: var(--accent-blue);
  font-size: 0.95rem;
}

/* Match Events Timeline */
.match-events-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.finalize-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.finalize-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  animation: fadeIn 0.2s ease-out;
}

.event-details {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.event-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.event-icon-badge.goal {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.event-icon-badge.assist {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.event-icon-badge.own-goal {
  background: rgba(244, 63, 94, 0.18);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.event-player-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-team-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.btn-delete-event {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-delete-event:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.empty-events-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 1rem 0;
}

/* Rosters & In-Game Team Swap Section */
.finalize-rosters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.roster-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.roster-team-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
}


.roster-player-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.roster-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.roster-player-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.roster-player-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-player-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.roster-switch-btn {
  padding: 0.25rem 0.45rem;
  font-size: 0.68rem;
  flex-shrink: 0;
  border-radius: 4px;
}

/* Quick Player Picker Dialog */
.player-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.player-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.player-pick-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-green);
  transform: translateX(3px);
}

.player-pick-item.own-goal-item {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
  color: #fecdd3;
}

.player-pick-item.own-goal-item:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .finalize-scoreboard-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .scoreboard-vs-divider {
    display: none;
  }
  .finalize-rosters-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .view-header {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .view-title h1 {
    font-size: 1.55rem;
  }

  .view-header > .btn,
  .match-detail-actions .btn {
    width: 100%;
  }

  .glass-card {
    padding: 1rem;
  }

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

  .search-input-wrapper {
    max-width: none;
  }

  .athletes-actions > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .filter-select {
    min-width: 0;
    width: 100%;
  }

  .finances-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    min-width: 0;
  }

  .stat-details {
    min-width: 0;
  }

  .stat-details p {
    overflow-wrap: anywhere;
  }

  .match-detail-actions {
    flex-direction: column;
    width: 100%;
  }

  .player-select-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .player-info-meta {
    flex-wrap: wrap;
    min-width: 0;
  }

  .player-select-actions {
    justify-content: space-between;
    width: 100%;
  }

  .soccer-field {
    min-height: 0;
    padding: 0.75rem;
  }

  .team-block {
    padding: 0.85rem;
  }

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

  .modal-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 0.75rem;
    height: 100dvh;
    max-height: 100dvh;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-content {
    margin: auto 0;
    max-height: none;
  }

  #finalize-players-container {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .finalize-scoreboard {
    gap: 0.65rem !important;
    padding: 0.85rem !important;
  }

  .finalize-scoreboard .form-label {
    font-size: 0.76rem !important;
  }

  .finalize-scoreboard .form-control {
    font-size: 1.5rem !important;
    height: 52px !important;
    padding: 0.5rem !important;
  }

  .match-stat-player-header {
    align-items: stretch;
    flex-direction: column;
  }

  .switch-team-btn {
    width: 100%;
  }

  .match-stat-counters {
    align-items: stretch;
    flex-direction: column;
  }

  .match-stat-counters .stat-counter {
    justify-content: space-between;
  }

  .transactions-table-wrapper,
  .ranking-table-wrapper {
    overflow: visible;
    border: 0;
  }

  .tx-table,
  .ranking-table,
  .tx-table tbody,
  .ranking-table tbody {
    display: block;
    width: 100%;
  }

  .tx-table thead,
  .ranking-table thead {
    display: none;
  }

  .tx-table tr,
  .ranking-table tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
  }

  .tx-table td,
  .ranking-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.55rem 0;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    overflow-wrap: anywhere;
  }

  .tx-table td:last-child,
  .ranking-table td:last-child {
    border-bottom: 0;
  }

  .tx-table td::before,
  .ranking-table td::before {
    flex: 0 0 38%;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .tx-table td:nth-child(1)::before { content: 'Data'; }
  .tx-table td:nth-child(2)::before { content: 'Descrição'; }
  .tx-table td:nth-child(3)::before { content: 'Categoria'; }
  .tx-table td:nth-child(4)::before { content: 'Tipo'; }
  .tx-table td:nth-child(5)::before { content: 'Valor'; }
  .tx-table td:nth-child(6)::before { content: 'Ações'; }
  .ranking-table td:nth-child(1)::before { content: 'Posição'; }
  .ranking-table td:nth-child(2)::before { content: 'Atleta'; }
  .ranking-table td:nth-child(3)::before { content: 'Pontos'; }
  .ranking-table td:nth-child(4)::before { content: 'Partidas'; }
  .ranking-table td:nth-child(5)::before { content: 'Gols'; }
  .ranking-table td:nth-child(6)::before { content: 'Assistências'; }
  .ranking-table td:nth-child(7)::before { content: 'Roubadas'; }
  .ranking-table td:nth-child(8)::before { content: 'Aproveitamento'; }
  .ranking-table td:nth-child(9)::before { content: 'Participação'; }
  .ranking-table td:nth-child(10)::before { content: 'Bam-Bam-Bam'; }
  .ranking-table td:nth-child(11)::before { content: 'Bum-Bum-Bum'; }

  .ranking-position-col {
    text-align: right;
  }

  .rank-player-name-wrapper {
    justify-content: flex-end;
  }

  .tx-table td[colspan],
  .ranking-table td[colspan] {
    display: block;
    text-align: center !important;
  }

  .tx-table td[colspan]::before,
  .ranking-table td[colspan]::before {
    content: none;
  }
}

@media (max-width: 390px) {
  .main-content {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .mobile-nav-item {
    font-size: 0.58rem;
  }

  .mobile-nav-item i {
    font-size: 1.15rem;
  }
}


/* Keep the complete ranking table on mobile, matching the desktop layout. */
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .ranking-table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 190px);
    border: 1px solid var(--border-color);
  }

  .ranking-table {
    display: table;
    width: 100%;
    min-width: 1000px;
  }

  .ranking-table thead { display: table-header-group; }
  .ranking-table tbody { display: table-row-group; }

  .ranking-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .ranking-table th,
  .ranking-table td {
    display: table-cell;
    width: auto;
    padding: 1rem;
    text-align: left;
    overflow-wrap: normal;
  }

  .ranking-table td::before {
    content: none !important;
    display: none;
  }

  .ranking-table .ranking-position-col {
    width: 60px;
    text-align: center;
  }

  .ranking-table .rank-player-name-wrapper { justify-content: flex-start; }
  .ranking-table td[colspan] { display: table-cell; }
}

/* Multi-user access and MVP voting */
.access-card { width: min(92vw, 480px); padding: 2rem; display: grid; gap: 1.25rem; text-align: center; }
.access-message { color: var(--text-secondary); line-height: 1.6; }
.access-actions { gap: 0.75rem; }
.form-hint { display: block; margin-top: 0.35rem; color: var(--text-muted); font-size: 0.75rem; }
.settings-main-card { width: 100%; max-width: 1100px; }
.settings-main-card > #settings-form { max-width: 600px; }
.group-invites-panel { width: 100%; margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.section-heading-inline h3 { margin-bottom: 0.35rem; }
.section-heading-inline p { color: var(--text-secondary); font-size: 0.85rem; }
.invite-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.athlete-invites-list { display: grid; margin-top: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.athlete-invite-row { display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.5fr) minmax(260px, auto) 110px; gap: 0.75rem; align-items: center; padding: 0.85rem; background: var(--bg-primary); }
.athlete-invite-row + .athlete-invite-row { border-top: 1px solid var(--border-color); }
.athlete-invite-identity { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.athlete-invite-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.athlete-invite-identity span { color: var(--text-muted); font-size: 0.75rem; }
.athlete-invite-link { min-width: 0; font-size: 0.75rem; }
.athlete-invite-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.athlete-invite-copy, .athlete-invite-renew { min-width: 125px; white-space: nowrap; }
.login-browser-hint { margin: -0.35rem 0 0; color: var(--text-muted); font-size: 0.72rem; line-height: 1.45; }
.invite-status { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.4rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.invite-status.accepted { color: #86efac; background: rgba(34, 197, 94, 0.14); }
.invite-status.pending { color: #fcd34d; background: rgba(245, 158, 11, 0.14); }
.invites-empty { padding: 1rem; color: var(--text-muted); text-align: center; }
.mvp-voting-card { margin-top: 1.5rem; }
.mvp-voting-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mvp-voting-heading h3 { margin: 0.2rem 0 0.35rem; }
.mvp-voting-heading p { color: var(--text-secondary); font-size: 0.85rem; }
.eyebrow { color: var(--accent-amber); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mvp-vote-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; margin: 1rem 0; }
.mvp-vote-results { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--border-color); }
.mvp-vote-results li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.mvp-vote-results .empty-votes { color: var(--text-muted); }
.member-mode .settings-nav { display: list-item; }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .invite-panel-heading { align-items: stretch; flex-direction: column; }
  .invite-panel-heading .btn { width: 100%; }
  .athlete-invite-row { grid-template-columns: minmax(0, 1fr) auto; }
  .athlete-invite-link { grid-column: 1 / -1; }
  .athlete-invite-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .athlete-invite-copy, .athlete-invite-renew { width: 100%; min-width: 0; }
  .invite-status { grid-column: 2; grid-row: 1; }
  .mvp-vote-form { grid-template-columns: 1fr; }
  .mvp-voting-heading { flex-direction: column; }
  .mvp-voting-heading .btn { width: 100%; }
}
/* Attendance decisions and voting closure */
.attendance-choice { display: inline-flex; gap: 0.45rem; flex: 0 0 auto; }
.attendance-choice-btn { width: 38px; height: 38px; border: 2px solid transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; opacity: 0.55; transition: var(--transition); }
.attendance-choice-btn:hover:not(:disabled), .attendance-choice-btn.selected { opacity: 1; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25); }
.attendance-choice-btn:disabled { cursor: not-allowed; opacity: 0.35; }
.attendance-yes { background: #16a34a; border-color: #22c55e; }
.attendance-no { background: #dc2626; border-color: #ef4444; }
.attendance-choice-btn i { font-size: 1rem; }
.attendance-status-badge { margin-left: 0.5rem; font-size: 0.65rem; padding: 0.1rem 0.4rem; text-transform: none; }
.attendance-absent-badge { color: #fecaca; background: rgba(220, 38, 38, 0.15); border-color: rgba(239, 68, 68, 0.45); }
.mvp-admin-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .attendance-choice { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
  .attendance-choice-btn { width: 48px; height: 48px; }
  .mvp-admin-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
}
.attendance-pending-badge { color: #fde68a; background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.45); }

/* ================= Escalação interativa (banco + campo) ================= */
.match-side-column { min-width: 0; }

.lineup-card { margin-bottom: 1.5rem; }
.lineup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.lineup-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; font-weight: 700; }
.lineup-title i { color: var(--accent-green); }
.lineup-subtitle { margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.85rem; max-width: 640px; }

.lineup-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: 0.9rem;
}
.lineup-balance i { margin-right: 0.3rem; }
.lineup-balance small { color: var(--text-secondary); font-size: 0.75rem; }
.lineup-balance.balance-good { border-color: hsla(142, 71%, 45%, 0.45); }
.lineup-balance.balance-good i { color: var(--accent-green); }
.lineup-balance.balance-warn { border-color: rgba(245, 158, 11, 0.5); }
.lineup-balance.balance-warn i { color: var(--accent-amber); }
.lineup-balance.balance-bad { border-color: rgba(244, 63, 94, 0.5); }
.lineup-balance.balance-bad i { color: var(--accent-rose); }

.lineup-board { display: flex; flex-direction: column; gap: 1.25rem; }

.lineup-bench {
  --formation-team-color: #475569;
  --formation-team-ink: #ffffff;
  padding: 0.9rem 1rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition);
}
.lineup-bench-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.lineup-bench-title i { color: var(--accent-amber); margin-right: 0.35rem; }
.lineup-bench-title strong {
  display: inline-flex;
  min-width: 1.6rem;
  justify-content: center;
  margin-left: 0.3rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  font-size: 0.8rem;
}
.lineup-bench-title small { color: var(--text-muted); font-size: 0.75rem; font-weight: 500; }
.lineup-bench-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.35rem;
  min-height: 92px;
  align-items: flex-start;
}
.lineup-bench-empty { align-self: center; margin: 0 auto; color: var(--text-muted); font-size: 0.85rem; }

.lineup-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}
.lineup-main .formations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.lineup-board [data-drop-zone] { transition: var(--transition); }
.lineup-board.is-editable.has-selection [data-drop-zone] { outline: 2px dashed hsla(142, 71%, 45%, 0.45); outline-offset: 2px; }
.lineup-board [data-drop-zone].drop-hover {
  outline: 3px solid var(--accent-green) !important;
  outline-offset: 2px;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}

/* Círculo do atleta */
.lineup-token {
  position: relative;
  padding: 0.15rem 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
}
button.lineup-token { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
button.lineup-token:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 2px; }
.lineup-bench .formation-player-name { color: var(--text-primary); text-shadow: none; }
.lineup-token.is-selected .formation-player-shirt {
  box-shadow: 0 0 0 4px var(--accent-green), 0 6px 14px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.lineup-token.dragging { opacity: 0.3; }
.lineup-token .formation-player-shirt { position: relative; transition: var(--transition); }
.lineup-token-skill {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid #0f172a;
  border-radius: 999px;
  background: var(--accent-amber);
  color: #0f172a;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}
.lineup-token-stats {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  font-size: 0.65rem;
  font-weight: 800;
}
.lineup-token-stats span { display: inline-flex; align-items: center; gap: 0.15rem; color: var(--accent-amber); }
.lineup-token-stats span + span { color: #93c5fd; }

.lineup-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}
.lineup-ghost .formation-player-name { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95); }
body.lineup-dragging, body.lineup-dragging * { cursor: grabbing !important; user-select: none; }

.formation-skill-sum {
  flex: 0 0 auto;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--formation-team-color);
  color: var(--formation-team-ink);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.formation-drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 460px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Jogo anterior */
.previous-lineup {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.previous-lineup-header { margin-bottom: 0.75rem; }
.previous-lineup-header h4 { display: flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; font-weight: 700; }
.previous-lineup-header h4 i { color: var(--accent-blue); }
.previous-lineup-header span { display: block; margin-top: 0.2rem; color: var(--text-secondary); font-size: 0.75rem; }
.previous-lineup-empty { color: var(--text-muted); font-size: 0.8rem; }
.previous-repeat {
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.previous-repeat.repeat-good { background: rgba(16, 185, 129, 0.12); color: #86efac; }
.previous-repeat.repeat-warn { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.previous-repeat.repeat-bad { background: rgba(244, 63, 94, 0.14); color: #fda4af; }
.previous-team + .previous-team { margin-top: 0.85rem; }
.previous-team-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
  border-bottom: 2px solid var(--previous-team-color);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}
.previous-team-title strong { margin-left: auto; }
.previous-team-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--previous-team-color); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4); }
.previous-team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.previous-team li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; font-size: 0.8rem; }
.previous-pos { flex: 0 0 auto; font-size: 0.55rem; padding: 0.05rem 0.3rem; }
.previous-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.previous-now-chip {
  flex: 0 0 auto;
  max-width: 92px;
  overflow: hidden;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.previous-now-chip.is-bench { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.previous-now-chip.is-out { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.previous-lineup-hint { margin-top: 0.85rem; color: var(--text-muted); font-size: 0.7rem; }

@media (max-width: 1280px) {
  .lineup-main { grid-template-columns: 1fr; }
  .previous-lineup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
  .previous-lineup > .previous-lineup-header,
  .previous-lineup > .previous-repeat,
  .previous-lineup > .previous-lineup-hint,
  .previous-lineup > .previous-lineup-empty { grid-column: 1 / -1; }
  .previous-team + .previous-team { margin-top: 0; }
}
@media (max-width: 760px) {
  .lineup-main .formations-grid { grid-template-columns: 1fr; }
  .lineup-balance { align-items: flex-start; width: 100%; }
  .previous-lineup { grid-template-columns: 1fr; }
  .previous-team + .previous-team { margin-top: 0.85rem; }
  .match-detail-actions { flex-wrap: wrap; width: 100%; }
  .match-detail-actions .btn { flex: 1 1 auto; }
}

/* ================= Votação Bam-Bam-Bam / Bum-Bum-Bum ================= */
.vote-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.vote-panel {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.vote-panel-best { border-color: rgba(245, 158, 11, 0.45); background: linear-gradient(160deg, rgba(245, 158, 11, 0.1), transparent 60%), var(--bg-secondary); }
.vote-panel-worst { border-color: rgba(168, 120, 72, 0.5); background: linear-gradient(160deg, rgba(168, 120, 72, 0.14), transparent 60%), var(--bg-secondary); }
.vote-panel-title { display: flex; align-items: center; gap: 0.75rem; }
.vote-panel-title h4 { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; }
.vote-panel-title small { color: var(--text-secondary); font-size: 0.75rem; }
.vote-panel-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
}
.vote-panel-best .vote-panel-icon { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.vote-panel-worst .vote-panel-icon { background: rgba(168, 120, 72, 0.25); color: #d6a26b; }
.vote-panel .mvp-vote-form { margin: 0.9rem 0 0; }
.vote-panel .mvp-vote-results li.is-leader strong { color: var(--accent-amber); }
.vote-panel-worst .mvp-vote-results li.is-leader strong { color: #d6a26b; }
.match-vote-worst > i, .match-vote-worst span { color: #d6a26b; }
.match-vote-worst { margin-top: 0.5rem; }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .vote-panels { grid-template-columns: 1fr; }
}

/* ================= Ranking: filtros de temporada/mês ================= */
.ranking-filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ranking-filter-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 150px; }
.ranking-filter-group .form-label { margin-bottom: 0; }
.ranking-period-label { margin-left: auto; color: var(--text-secondary); font-size: 0.85rem; }
.ranking-period-label i { color: var(--accent-green); margin-right: 0.35rem; }
.rank-vote { font-weight: 700; white-space: nowrap; }
.rank-vote-best i { color: var(--accent-amber); }
.rank-vote-worst i { color: #d6a26b; }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .ranking-filter-group { flex: 1 1 140px; }
  .ranking-period-label { width: 100%; margin-left: 0; }
  .ranking-table { min-width: 1180px; }
}


/* Filtro de atletas na tela de confirmação */
.match-players-filter {
  max-width: none;
  margin-bottom: 0.75rem;
}

.match-players-filter .search-input {
  font-size: 16px; /* evita zoom automático no celular */
}

.match-players-filter-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}


/* ===== Financeiro: filtro por período ===== */
.finance-filter-bar { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; }
.finance-filter-group { margin-bottom: 0; display: flex; align-items: center; gap: 0.75rem; }
.finance-filter-group .form-label { margin-bottom: 0; white-space: nowrap; }
.finance-filter-hint { flex-basis: 100%; margin: 0; font-size: 0.78rem; color: var(--text-secondary); }
.finance-filter-hint i { margin-right: 0.3rem; color: var(--accent-blue); }
.tx-ref-month { display: block; margin-top: 0.15rem; font-size: 0.7rem; color: var(--accent-blue); white-space: nowrap; }
@media (max-width: 640px) {
  .finance-filter-group { width: 100%; flex-wrap: wrap; }
  .finance-filter-group .form-control { width: 100% !important; }
  .finance-filter-bar .btn { width: 100%; }
}

/* ===== Roubadas de bola ===== */
.team-stat-actions { flex-wrap: wrap; }
.btn-stat-steal { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); color: #bbf7d0; }
.btn-stat-steal:hover { background: rgba(34, 197, 94, 0.2); border-color: var(--accent-green); color: #fff; }
.btn-stat-steal i { color: var(--accent-green); font-size: 0.95rem; }
.event-icon-badge.steal { background: rgba(34, 197, 94, 0.18); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.4); }
.lineup-token-stats span.tk-goals { color: var(--accent-amber); }
.lineup-token-stats span.tk-assists { color: #93c5fd; }
.lineup-token-stats span.tk-steals { color: #86efac; }

/* ===== Votação: atalho no topo da partida ===== */
.vote-cta-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; padding: 0.85rem 1.1rem;
  border: 1px solid rgba(245, 158, 11, 0.45); border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.03));
}
.vote-cta-banner > div { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.vote-cta-banner > div i { color: var(--accent-amber); font-size: 1.15rem; }
.vote-panel-mine { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.vote-panel-mine i { color: var(--accent-green); margin-right: 0.25rem; }
@media (max-width: 640px) { .vote-cta-banner .btn { width: 100%; } }

/* ===== Pop-up de votação + estatísticas ===== */
.vote-modal-content { max-width: 640px; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.vote-modal-heading .eyebrow { color: var(--accent-amber); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.vote-modal-heading .eyebrow.is-closed { color: var(--text-muted); }
.vote-modal-heading h2 { margin-top: 0.15rem; }
.vote-modal-heading p { margin-top: 0.2rem; font-size: 0.82rem; color: var(--text-secondary); }
.vote-modal-content .modal-header { align-items: flex-start; }
.vote-steps { list-style: none; display: flex; gap: 0.5rem; margin: -0.5rem 0 1.25rem; padding: 0; }
.vote-steps li {
  flex: 1; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
}
.vote-steps li span {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); font-size: 0.72rem; flex-shrink: 0;
}
.vote-steps li.active { color: var(--text-primary); border-color: var(--accent-green); }
.vote-steps li.active span { background: var(--accent-green); color: #04120a; }
.vote-steps li.completed { color: var(--accent-green); }
.vote-steps li.completed span { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }
.vote-modal-intro { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.vote-modal-panels { margin-top: 0.75rem; }
.vote-modal-panels .vote-modal-select { margin-top: 0.9rem; }
.vote-modal-current { display: block; margin-top: 0.5rem; font-size: 0.75rem; color: var(--accent-green); }
.vote-modal-loading { text-align: center; padding: 2rem 0; color: var(--text-secondary); }

.stat-review-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1rem; }
.stat-review-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary);
}
.stat-review-label { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.stat-review-label > i { font-size: 1.2rem; width: 1.5rem; text-align: center; }
.stat-review-label strong { display: block; font-size: 0.95rem; }
.stat-review-label small { color: var(--text-secondary); font-size: 0.75rem; }
.stat-review-row.stat-goals .stat-review-label > i { color: var(--accent-amber); }
.stat-review-row.stat-assists .stat-review-label > i { color: var(--accent-blue); }
.stat-review-row.stat-steals .stat-review-label > i { color: var(--accent-green); }
.stat-stepper { display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.stat-stepper output { min-width: 2rem; text-align: center; font-size: 1.35rem; font-weight: 800; }
.stat-stepper-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05); color: var(--text-primary); cursor: pointer; font-size: 0.9rem;
  transition: var(--transition);
}
.stat-stepper-btn:hover:not(:disabled) { border-color: var(--accent-green); background: rgba(34, 197, 94, 0.12); }
.stat-stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.vote-done { text-align: center; padding: 1rem 0 0.5rem; }
.vote-done > i { font-size: 2.75rem; color: var(--accent-green); }
.vote-done h3 { margin-top: 0.6rem; font-size: 1.25rem; }
.vote-done p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.25rem; }
.vote-done-stats { display: inline-flex; gap: 1rem; margin-top: 0.9rem; font-weight: 700; }
.vote-done-stats .stat-goals i, .stat-report-values .stat-goals i { color: var(--accent-amber); }
.vote-done-stats .stat-assists i, .stat-report-values .stat-assists i { color: var(--accent-blue); }
.vote-done-stats .stat-steals i, .stat-report-values .stat-steals i { color: var(--accent-green); }

/* Painel do administrador: estatísticas revisadas pelos atletas */
.stat-reports-panel { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-color); }
.stat-reports-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stat-reports-heading h4 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.stat-reports-heading h4 i { color: var(--accent-green); }
.stat-reports-hint, .stat-reports-empty { font-size: 0.8rem; color: var(--text-secondary); margin: 0.35rem 0 0.75rem; }
.stat-reports-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.stat-report-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.85rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-secondary);
}
.stat-report-row.is-adjusted { border-color: rgba(59, 130, 246, 0.45); }
.stat-report-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.stat-report-values { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; font-weight: 700; }
.stat-report-values > span { display: inline-flex; gap: 0.6rem; }
.stat-report-values .stat-report-before { opacity: 0.55; text-decoration: line-through; }
.stat-report-values > i { color: var(--text-muted); font-size: 0.75rem; }
@media (max-width: 640px) {
  .stat-report-row { grid-template-columns: 1fr; }
  .stat-report-row .btn { width: 100%; }
  .vote-steps li { font-size: 0.72rem; padding: 0.45rem 0.5rem; }
  .vote-modal-content { max-height: none; }
  .stat-review-row { padding: 0.7rem 0.8rem; }
}


/* ===== Registro da partida: marcação direto na lista de atletas ===== */
#finalize-modal .modal-content { max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.finalize-scorebar {
  position: sticky; top: -1px; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 0.6rem;
  margin: 0 0 1rem; padding: 0.6rem 0.75rem;
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.7);
}
.finalize-scorebar-team { display: flex; align-items: center; gap: 0.45rem; min-width: 0; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.finalize-scorebar-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finalize-scorebar-team.is-right { justify-content: flex-end; text-align: right; }
.finalize-scorebar-emblem { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.finalize-scorebar .scoreboard-score-input { width: 64px; height: 48px; font-size: 1.6rem; padding: 0.25rem; }
.finalize-scorebar .scoreboard-vs-divider { display: block; font-size: 1.1rem; }

.finalize-stat-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.65rem; }
.finalize-stat-legend i { margin-right: 0.2rem; }
.stat-ic-goal { color: var(--accent-amber); }
.stat-ic-assist { color: var(--accent-blue); }
.stat-ic-steal { color: var(--accent-green); }
.finalize-switch-hint { font-size: 0.75rem; color: var(--text-secondary); margin: 0.65rem 0 0; }

.roster-team-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-color); }
.roster-team-head .roster-team-title { margin: 0; padding: 0; border: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.own-goal-btn { padding: 0.25rem 0.55rem; font-size: 0.7rem; flex-shrink: 0; }
.roster-player-row { padding: 0.35rem 0.45rem 0.35rem 0.6rem; transition: background 0.25s ease, border-color 0.25s ease; }
.roster-player-row.just-marked { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.5); }
.roster-player-number { font-weight: 700; color: var(--text-secondary); font-size: 0.75rem; flex-shrink: 0; }
.roster-player-pos { font-size: 0.6rem; padding: 0.05rem 0.3rem; flex-shrink: 0; }
.roster-stat-actions { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.roster-stat-btn {
  position: relative; width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary); font-size: 0.9rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform 0.1s ease, background 0.2s ease;
}
.roster-stat-btn:active { transform: scale(0.9); }
.roster-stat-btn.goal { color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); }
.roster-stat-btn.assist { color: var(--accent-blue); border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.08); }
.roster-stat-btn.steal { color: var(--accent-green); border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.roster-switch-icon { margin-left: 0.15rem; }
.roster-stat-count {
  position: absolute; top: -7px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; font-size: 0.65rem; font-weight: 800; line-height: 17px; color: #0b1220;
}
.roster-stat-btn.goal .roster-stat-count { background: var(--accent-amber); }
.roster-stat-btn.assist .roster-stat-count { background: var(--accent-blue); color: #fff; }
.roster-stat-btn.steal .roster-stat-count { background: var(--accent-green); }
.event-icon-badge.steal { background: rgba(34, 197, 94, 0.18); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.4); }

@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .finalize-scorebar { top: -0.75rem; padding: 0.5rem 0.6rem; gap: 0.4rem; }
  .finalize-scorebar-team { font-size: 0.72rem; }
  .finalize-scorebar .scoreboard-score-input { width: 52px; height: 42px; font-size: 1.35rem; }
  .finalize-scorebar-emblem, .finalize-scorebar-team i { display: none !important; }
}
@media (max-width: 400px) {
  .roster-player-pos { display: none; }
  .roster-stat-btn { width: 32px; height: 32px; }
}

/* ===== Celular deitado (paisagem): layout de celular aproveitando a largura ===== */
@media (orientation: landscape) and (max-height: 500px) {
  .finalize-rosters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .roster-player-pos { display: none; }
  #finalize-modal .modal-content { max-width: 100% !important; }
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finances-header { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 0.75rem !important; }
  .mobile-nav-bar { padding: 0.35rem 0 !important; }
  .mobile-nav-item { flex-direction: row !important; justify-content: center; gap: 0.4rem !important; font-size: 0.75rem !important; }
  .mobile-nav-item i { font-size: 1.05rem !important; }
  .main-content { padding-bottom: 3.75rem !important; }
  .vote-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Telas intermediárias (tablet / notebook pequeno): sem rolagem para o lado ===== */
.dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card, .stat-details { min-width: 0; }
.stat-details h3, .stat-details p { overflow-wrap: anywhere; }
.transactions-table-wrapper { max-width: 100%; overflow-x: auto; }
@media (max-width: 1100px) {
  .finances-header { flex-wrap: wrap; }
  .finances-header > .stat-card { flex: 1 1 200px !important; }
  .stat-card { gap: 0.85rem; }
}
@media (min-width: 900px) {
  #finalize-modal .modal-content { max-width: 880px !important; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .view-header { flex-direction: row !important; align-items: center !important; }
  .view-header > .btn { width: auto !important; flex-shrink: 0; }
}

/* Cores dos times nas configurações */
.team-color-mode {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.team-color-mode-option { cursor: pointer; }
.team-color-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.team-color-mode-option span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.team-color-mode-option input:checked + span { background: var(--bg-card-hover); color: var(--text-primary); }
.team-color-mode-option input:focus-visible + span { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.team-color-mode-option input:disabled + span { cursor: not-allowed; opacity: 0.6; }
.team-color-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.team-color-swatch { position: relative; display: block; width: 34px; height: 34px; cursor: pointer; }
.team-color-swatch input[type="radio"] { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.team-color-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--swatch-color);
  border: 2px solid hsla(217, 32%, 80%, 0.35);
  color: var(--swatch-ink);
  font-size: 0.8rem;
  transition: var(--transition);
}
.team-color-dot i { display: none; }
.team-color-swatch input[type="radio"]:checked + .team-color-dot {
  border-color: var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--text-primary);
}
.team-color-swatch input[type="radio"]:checked + .team-color-dot i { display: block; }
.team-color-swatch input[type="radio"]:focus-visible + .team-color-dot { outline: 2px solid var(--accent-blue); outline-offset: 3px; }
.team-color-swatch input:disabled { cursor: not-allowed; }
.team-color-custom input[type="radio"]:not(:checked) + .team-color-dot {
  background: conic-gradient(#ef4444, #facc15, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444);
}
.team-color-custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.team-color-field[hidden], #settings-team-color-random-hint[hidden] { display: none; }

/* Etiqueta do time: mesma cor em todas as telas, legível até com preto no fundo escuro */
.team-pill {
  --team-color: #475569;
  --team-ink: #ffffff;
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--team-color);
  color: var(--team-ink);
  box-shadow: 0 0 0 1px hsla(217, 32%, 80%, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.team-pill-sm { padding: 0.05rem 0.4rem; font-size: 0.62rem; max-width: 150px; }
.placar-team-pill { flex: 0 1 auto; }
.lineup-balance-score .team-pill { max-width: 120px; }
.finalize-scorebar-team span.team-pill { padding: 0.2rem 0.6rem; }
.roster-team-title.team-pill { padding: 0.2rem 0.65rem; font-size: 0.8rem; }
.player-pick-item .team-pill { flex-shrink: 0; max-width: 55%; }
@media (max-width: 640px) {
  .finalize-scorebar-team span.team-pill {
    padding: 0.2rem 0.3rem;
    border-radius: 10px;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .match-placar { gap: 0.6rem; }
}
@media (max-width: 400px) {
  .finalize-scorebar .scoreboard-score-input { width: 46px; }
}

/* ===== Acesso: link do grupo, pedidos e aprovação (v4.8) ===== */
.inapp-warning { display: grid; gap: 0.6rem; padding: 0.9rem 1rem; text-align: left; border: 1px solid rgba(245, 158, 11, 0.45); border-radius: var(--radius-md); background: rgba(245, 158, 11, 0.1); }
.inapp-warning strong { color: #fcd34d; font-size: 0.85rem; }
.inapp-warning p { margin: 0; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.45; }
.inapp-warning .btn { width: 100%; }
.access-user { margin: 0; color: var(--text-muted); font-size: 0.75rem; word-break: break-all; }
.access-footer-actions { display: grid; gap: 0.6rem; }
.join-request-form { text-align: left; }
.pending-status { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.8rem 1rem; text-align: left; font-size: 0.85rem; line-height: 1.45; border-radius: var(--radius-md); }
.pending-status i { margin-top: 0.15rem; }
.pending-status.sent { color: #fcd34d; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); }
.pending-status.draft { color: #93c5fd; background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.35); }
.join-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.6rem; margin-top: 1rem; }
.join-link-row .form-control { font-size: 0.8rem; }
.access-subtitle { display: flex; align-items: center; gap: 0.5rem; margin: 1.5rem 0 0; font-size: 0.95rem; }
.access-count { min-width: 1.4rem; padding: 0.1rem 0.45rem; border-radius: 999px; color: #1f1300; background: #fcd34d; font-size: 0.72rem; font-weight: 800; text-align: center; }
.access-count:empty { display: none; }
.access-note { color: #fcd34d !important; }
.badge-app-linked { background: rgba(16, 185, 129, 0.18); color: var(--accent-green); }
.badge-app-unlinked { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .join-link-row { grid-template-columns: 1fr 1fr; }
  .join-link-row .form-control { grid-column: 1 / -1; }
  .athlete-invite-actions:has(> :only-child) { grid-template-columns: 1fr; }
  .athlete-invite-actions:empty { display: none; }
}

/* ===== Meu Perfil (v4.9) ===== */
.profile-card { max-width: 560px; display: grid; gap: 1.25rem; }
.profile-unlinked { display: flex; align-items: center; gap: 0.85rem; padding: 1rem; color: var(--text-secondary); border: 1px dashed var(--border-color); border-radius: var(--radius-md); }
.profile-unlinked i { font-size: 1.6rem; color: var(--text-muted); }
.profile-unlinked p { margin: 0; line-height: 1.45; }
.profile-photo-block { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.profile-avatar { width: 112px; height: 112px; flex: 0 0 112px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 800; color: var(--text-primary); background: var(--bg-secondary); border: 3px solid var(--accent-green); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-actions { display: grid; gap: 0.5rem; flex: 1; }
.profile-photo-actions .btn { width: 100%; justify-content: center; }
.profile-upload-label { cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; }
.profile-readonly { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.profile-readonly div { display: grid; gap: 0.2rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border-color); }
.profile-readonly span { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rank-player-avatar { overflow: hidden; }
.rank-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .profile-photo-block { flex-direction: column; text-align: center; }
  .profile-photo-actions { width: 100%; }
  .settings-profile-shortcut { display: inline-flex; }
}

/* Foto do perfil no círculo do atleta (sorteio / escalação) */
.formation-player-shirt.has-photo {
  position: relative;
  padding: 0;
  border: 3px solid var(--formation-team-color);
  background: var(--formation-team-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.82), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.formation-player-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.formation-player-number {
  position: absolute;
  bottom: -5px;
  left: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid #0f172a;
  border-radius: 999px;
  background: var(--formation-team-color);
  color: var(--formation-team-ink);
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}
