:root {
  --green: #007A33;
  --orange: #FF6F00;
  --bg-light: #0E223A;         /* deep blue background */
  --bg-dark: #14243A;          /* slightly lighter blue for cards */
  --text-dark: #fff;
  --text-light: #b6c2d1;
  --border: #1e3550;
  --radius: 12px;
  --shadow: 0 4px 24px 0 rgba(0,0,0,0.18); /* softer, larger shadow */
}

body {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #15304b 60%, #0e223a 100%);
  margin: 0;
  color: var(--text-dark);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 1.5rem;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  background: var(--bg-dark);
  box-shadow: var(--shadow);
  border-bottom: 6px solid transparent;
  border-image: linear-gradient(90deg, #169b62 0%, #ffffff 50%, #ff883e 100%) 1;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.logo {
  width: 80px;
  height: auto;
  margin-right: 1.5rem;
}

.header .logo {
  width: 120px;
}

.brand {
  display: flex;
  align-items: center;
}

h1 {
  font-size: 2.2rem;
  margin: 0;
  color: var(--green);
}

/* Make headings bold and modern */
h1, h2, h3, .section-title, .table th {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1, .main-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.2em;
  margin-top: 0.5em;
}

.nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--green);
  font-weight: 600;
}

.nav a:hover {
  color: var(--orange);
}

.section-title {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--green);
  border-left: 6px solid var(--orange);
  padding-left: 0.75rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 2.5rem 0 1.2rem 0;
  background: none;
  border: none;
  color: #fff;
}

/* Center section titles like "League Table", "Fixtures", "Results" */
.section-title {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.section-title strong {
  color: var(--green);
}

.section-title .accent {
  color: var(--orange);
}

/* Subtle green glow around cards (standings, fixtures, etc) */
.card {
  background: rgba(20,36,58,0.98);
  border-radius: 18px;
  box-shadow:
    0 4px 32px 0 rgba(0,0,0,0.18),
    0 0 0 2px rgba(0,122,51,0.13);
  border: 1px solid rgba(0,122,51,0.13);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  color: #fff;
  font-size: 1.08rem;
}
.table th, .table td {
  padding: 1.1rem 0.7rem;
  text-align: center;
  font-weight: 700;
  border-bottom: none;
  background: transparent;
}
.table th {
  background: none;
  color: #b6c2d1;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.table tr {
  border-radius: 12px;
  transition: background 0.18s;
}
.table tr:hover {
  background: linear-gradient(
    90deg,
    rgba(22,155,98,0.22) 0%,
    rgba(255,255,255,0.14) 20%,
    rgba(255,136,62,0.20) 38%,
    rgba(20,36,58,0.00) 100%
  );
  transition: background 0.18s;
}
.table tr:nth-child(1),
.table tr:nth-child(10) {
  background: linear-gradient(
    90deg,
    rgba(22,155,98,0.24) 0%,
    rgba(255,255,255,0.16) 24%,
    rgba(255,136,62,0.22) 44%,
    rgba(20,36,58,0.98) 100%
  );
}
.table td:first-child {
  text-align: left;
  font-weight: 800;
  padding-left: 2rem;
}
.table td:last-child {
  text-align: right;
  padding-right: 2rem;
}

.table td.win {
  color: var(--green);
  font-weight: 700;
}
.table td.loss {
  color: var(--orange);
  font-weight: 700;
}

.round-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bracket-card {
  padding: 1.5rem 1.2rem;
}

.bracket-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.4rem;
  color: #fff;
}

.bracket {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  position: relative;
}

.bracket-column {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
}

.bracket-round-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

.bracket-stack {
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0.75rem;
  min-height: 520px;
  position: relative;
}

.bracket-match {
  background: rgba(12, 26, 44, 0.9);
  border: 1px solid rgba(0, 122, 51, 0.25);
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  position: relative;
}

.bracket-team {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
}

.bracket-score {
  color: var(--green);
  min-width: 2.5rem;
  text-align: right;
}

.bracket-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
}

.bracket-time {
  font-weight: 600;
}

/* Position matches to create the side pyramid */
.bracket-quarters .qf-1 { grid-row: 1; }
.bracket-quarters .qf-2 { grid-row: 3; }
.bracket-quarters .qf-3 { grid-row: 5; }
.bracket-quarters .qf-4 { grid-row: 7; }

.bracket-semis .sf-1 { grid-row: 2; }
.bracket-semis .sf-2 { grid-row: 6; }

.bracket-finals .tp-1 { grid-row: 2; }
.bracket-finals .f-1 { grid-row: 6; }

/* Connector lines for a simple side-pyramid look */
.bracket-column:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 2.4rem;
  bottom: 0.75rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(0,122,51,0.6), rgba(0,122,51,0.1));
}

.bracket-column:not(:first-child) .bracket-match::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 50%;
  width: 0.75rem;
  height: 2px;
  background: rgba(0,122,51,0.5);
}

.bracket-quarters .bracket-match::after {
  content: "";
  position: absolute;
  right: -0.85rem;
  top: 50%;
  width: 0.75rem;
  height: 2px;
  background: rgba(0,122,51,0.35);
}

/* Remove previous white hover for fixtures */
.round-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  background: transparent;
}

/* Add gradient hover effect to fixtures/results list items */
.round-item:hover {
  background: linear-gradient(
    90deg,
    rgba(22,155,98,0.22) 0%,
    rgba(255,255,255,0.14) 20%,
    rgba(255,136,62,0.20) 38%,
    rgba(20,36,58,0.00) 100%
  );
  transition: background 0.18s;
}

.round-right {
  text-align: right;
  font-weight: 600;
  color: var(--text-light);
}

.status {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-top: 0.3rem;
}

.status.live {
  background: var(--orange);
  color: white;
}

.status.played {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 50px;
  padding: 0.25rem 1.1rem;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: none;
  display: inline-block;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.status.played:hover,
.status.played:focus {
  background: rgba(0,122,51,0.10);
  color: var(--green);
  border-color: var(--green);
}

.status.scheduled {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 50px;
  padding: 0.25rem 1.1rem;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: none;
  display: inline-block;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.status.scheduled:hover,
.status.scheduled:focus {
  background: rgba(0,122,51,0.10);
  color: var(--green);
  border-color: var(--green);
}

.carousel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.carousel-content {
  flex: 1;
  min-width: 0; /* ESSENCIAL: Permite que encolha mesmo com conteúdo longo */
  padding: 0 0.5rem;
}



/* Minimal circular nav buttons with green border and arrow */
.nav-btn {
  background:var(--green);
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0.4rem 0.6rem;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;   /* Impede que a seta seja encolhida! */
}



.nav-btn:hover, .nav-btn:focus {
  background: rgba(0,122,51,0.10);
  filter:brightness(0.95);
  color: var(--green);
  border: 2px solid var(--green);
  transform: scale(1.08);
}

.nav-btn:active {
  transform: scale(0.98);
  background: #00441c;
  color: #fff;
}

/* Optional: Remove button outline on click for a cleaner look */
.nav-btn::-moz-focus-inner {
  border: 0;
}

.note {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-top: 3px solid var(--green);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.footer strong {
  color: #fff;
  font-weight: 700;
}

.footer a {
  color: var(--green);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.18s;
}

.footer a:hover {
  color: var(--orange);
}

.footer-social {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-top: 0.5rem;
}

.footer-icon-link {
  display: flex;
  align-items: center;
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.18s;
  gap: 0.5em;
}

.footer-icon-link:hover {
  color: var(--green);
}

.footer-icon svg {
  display: block;
  height: 1.5em;
  width: 1.5em;
}

.pill {
  display: inline-block;
  background: var(--orange);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.5rem;
  text-align: center;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  letter-spacing: 0.01em;
}

.pill.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 14px;
}

.pill-ghost {
  background: rgba(0,122,51,0.08);
  color: #fff;
  border: 1px solid rgba(0,122,51,0.25);
  box-shadow: none;
}

.admin-btn {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0.5rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
  box-shadow: none;
  outline: none;
}
.admin-btn:hover,
.admin-btn:focus {
  background: rgba(0,122,51,0.10);
  color: var(--green);
  border-color: var(--green);
}

/* Style the partners section to center content */
.partners {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.7rem;
  gap: 0.7rem;
}

/* Responsive adjustments for mobile */
#standingsTable {
  overflow-x: auto;
}
.table th, .table td {
  white-space: nowrap;
}

.lineup-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.lineup-inputs textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  padding: 0.9rem;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
}

.lineup-inputs label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-light);
  font-weight: 600;
}

.lineup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.lineup-actions {
  display: flex;
  gap: 0.5rem;
}

.lineup-controls {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.lineup-controls select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
}

.phase-toggle {
  display: flex;
  gap: 0.5rem;
}

.phase-toggle .pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
}

.phase-toggle .pill.active {
  background: var(--green);
  color: #fff;
}

.lineup-warnings {
  color: #ffb347;
  font-size: 0.95rem;
  margin-top: 0.4rem;
  min-height: 1.2rem;
}

.court-wrap {
  width: 100%;
}

.court-hint {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.court {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 140px);
  gap: 0.8rem;
  background: linear-gradient(180deg, rgba(0,122,51,0.15), rgba(20,36,58,0.85));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.75rem;
}

.court .zone {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem;
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 1px rgba(0,122,51,0.15);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.court .zone:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.court .zone .zone-number {
  font-weight: 800;
  color: var(--text-light);
  font-size: 0.9rem;
}

.court .zone .player {
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.court .zone .role {
  font-size: 0.85rem;
  color: var(--text-light);
}

.court .zone::after {
  content: attr(data-hint);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.court .zone:hover::after {
  opacity: 1;
}

.court .zone.server {
  border-color: var(--green);
}

.court .zone.libero {
  border-color: var(--orange);
}

.legend {
  margin-top: 0.6rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend .dot.server { background: var(--green); }
.legend .dot.libero { background: var(--orange); }

@media (max-width: 600px) {
  /* Header: stack brand and nav vertically */
  .header {
    flex-direction: column;
    align-items: center;
  }
  .header .brand {
    margin-bottom: 1rem;
  }
  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nav a {
    margin: 0.5rem 0;
    margin-left: 0;
    /* Área de clique maior para links */
    padding: 0.5rem 0;
  }
  /* Reduce heading size on smaller screens */
  h1 {
    font-size: 2rem;
  }
  .lineup-grid {
    grid-template-columns: 1fr;
  }
  .court {
    grid-template-rows: repeat(2, 120px);
  }
  .bracket {
    grid-template-columns: 1fr;
  }
  .bracket-stack {
    grid-template-rows: auto;
    min-height: 0;
  }
  .bracket-quarters .qf-1,
  .bracket-quarters .qf-2,
  .bracket-quarters .qf-3,
  .bracket-quarters .qf-4,
  .bracket-semis .sf-1,
  .bracket-semis .sf-2,
  .bracket-finals .tp-1,
  .bracket-finals .f-1 {
    grid-row: auto;
  }
  .bracket-column::before,
  .bracket-column .bracket-match::before,
  .bracket-quarters .bracket-match::after {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Stack action buttons vertically on very small screens */
  #scoreActions {
    flex-direction: column;
    align-items: stretch;
  }
  #scoreActions button {
    width: 100%;
    text-align: center;
  }
  /* Larger tap targets for plus/minus buttons */
  .row button {
    padding: 10px 14px;
  }
}

@media (max-width: 360px) {
  /* Extra small screens: stack logo above title */
  .brand {
    flex-direction: column;
    align-items: center;
  }
  .logo {
    margin: 0 0 0.5rem 0;
  }
}
