/* ==========================================================================
   COPA DOS PATROCINADORES - Premium Mobile-First Tournament Dashboard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700;800&display=swap');

:root {
  /* Color Palette - Premium Tennis Emerald */
  --bg-main: #030a06;
  --bg-surface: #07170e;
  --bg-surface-elevated: #0e2417;
  --bg-card: rgba(14, 36, 25, 0.88);
  --bg-card-hover: rgba(22, 54, 38, 0.95);
  --bg-glass: rgba(7, 23, 14, 0.92);

  --accent-neon: #10b981;
  --accent-lime: #a3e635;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;

  --border-subtle: rgba(34, 197, 94, 0.14);
  --border-medium: rgba(34, 197, 94, 0.28);
  --border-active: #10b981;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-accent: #34d399;

  --font-heading: 'Space Grotesk', 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 16px rgba(16, 185, 129, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.16) 0%, transparent 50%),
    radial-gradient(circle at 10% 40%, rgba(5, 150, 105, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(163, 230, 53, 0.05) 0%, transparent 40%),
    radial-gradient(rgba(34, 197, 94, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 5rem; /* Room for bottom bar on mobile */
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 0.85rem 2rem;
}

@media (min-width: 640px) {
  .app-container {
    padding: 0 1.25rem 3rem;
  }
}

/* Hero Header */
.hero-header {
  position: relative;
  padding: 1.5rem 0.5rem 1rem;
  text-align: center;
}

.hero-glow-banner {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 600px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, #a3e635, #10b981, transparent);
  box-shadow: 0 0 20px 2px rgba(16, 185, 129, 0.7);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-lime);
  margin-bottom: 0.6rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-lime);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.tournament-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 30%, #e2e8f0 60%, #34d399 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.2rem;
}

.tournament-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 3.2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #34d399;
  margin-bottom: 1.25rem;
}

/* Quick Stats Bar */
.tournament-stats-bar {
  display: flex;
  overflow-x: auto;
  gap: 0.6rem;
  padding: 0.3rem 0.2rem 0.8rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
}
.tournament-stats-bar::-webkit-scrollbar { display: none; }

.stat-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.stat-item strong {
  color: #fff;
}

/* Search Bar & Toolbar */
.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .toolbar-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
  }
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.2rem 0.75rem 2.5rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.92rem;
  font-family: var(--font-body);
  transition: var(--transition-normal);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-neon);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  background: rgba(0, 0, 0, 0.65);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-neon);
  font-size: 0.95rem;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  padding: 0.3rem;
  display: none;
  cursor: pointer;
}
.search-clear-btn.active { display: block; }

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}
@media (min-width: 640px) {
  .toolbar-actions { width: auto; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  flex: 1;
}
@media (min-width: 640px) {
  .btn { flex: initial; }
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #012419;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.btn-primary:active, .btn-primary:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: var(--border-medium);
}
.btn-outline:active, .btn-outline:hover {
  border-color: var(--accent-neon);
  color: var(--accent-neon);
  background: rgba(16, 185, 129, 0.12);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  flex: initial;
}

/* Category Navigation Tabs (Sticky) */
.nav-tabs-wrapper {
  position: sticky;
  top: 0.5rem;
  z-index: 60;
  margin-bottom: 1.25rem;
}

.nav-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.4rem;
  background: rgba(7, 23, 14, 0.95);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: var(--transition-fast);
}

.tab-btn.active {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.4);
}

/* Tab Content */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Category Header */
.category-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(14, 36, 25, 0.9), rgba(5, 20, 13, 0.95));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .category-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.cat-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cat-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.cat-badge {
  padding: 0.2rem 0.6rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-lime);
}

.bracket-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Mobile View Switcher & Round Tabs */
.mobile-view-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.view-mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-lime);
  border: 1px solid var(--border-medium);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Round Filter Pills for Mobile List View */
.round-filter-pills {
  display: flex;
  overflow-x: auto;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  scrollbar-width: none;
}
.round-filter-pills::-webkit-scrollbar { display: none; }

.round-pill {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.round-pill.active {
  background: var(--accent-neon);
  color: #012419;
  font-weight: 700;
  border-color: var(--accent-neon);
}

/* Mobile Simulation Info Bar */
.simulation-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: rgba(163, 230, 53, 0.08);
  border: 1px dashed var(--accent-lime);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--accent-lime);
  line-height: 1.4;
}

/* ==========================================================================
   MOBILE-FIRST LIST VIEW FOR BRACKETS
   ========================================================================== */

.bracket-list-view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.round-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.round-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.round-section-header h3 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-lime);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.round-matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 680px) {
  .round-matches-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  }
}

/* Match Card */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-fast);
}

.match-card:hover, .match-card:active {
  border-color: var(--accent-neon);
}

.match-card.is-highlighted {
  border-color: var(--accent-lime);
  box-shadow: 0 0 16px rgba(163, 230, 53, 0.45);
  transform: scale(1.01);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.match-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--accent-lime);
  font-family: var(--font-heading);
}

.match-status-badge {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-bye {
  background: rgba(107, 114, 128, 0.25);
  color: #9ca3af;
}

.status-scheduled {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-finished {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.match-participants {
  display: flex;
  flex-direction: column;
}

.player-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem; /* Large touch target for fingers */
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.player-slot:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-slot:active:not(.is-bye):not(.is-placeholder) {
  background: rgba(16, 185, 129, 0.2);
}

.player-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  overflow: hidden;
}

.player-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-slot.is-winner .player-name {
  color: #34d399;
  font-weight: 800;
}

.player-slot.is-winner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-neon);
}

.player-slot.is-bye .player-name {
  color: var(--text-dim);
  font-style: italic;
}

.player-slot.is-placeholder .player-name {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}

.player-score {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
}

.player-slot.is-winner .player-score {
  background: var(--accent-neon);
  color: #012419;
}

.winner-crown {
  font-size: 0.85rem;
  color: var(--accent-gold);
}

/* ==========================================================================
   BRACKET TREE VIEW (ÁRVORE PANORÂMICA)
   ========================================================================== */

.bracket-tree-view {
  display: none; /* hidden by default on mobile unless toggled */
  width: 100%;
  overflow-x: auto;
  padding: 1rem 0.5rem 1.5rem;
  background: radial-gradient(circle at 50% 50%, rgba(16, 40, 29, 0.25) 0%, transparent 80%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

.bracket-tree-view.active {
  display: block;
}

.bracket-tree {
  display: flex;
  gap: 1.5rem;
  min-width: 960px;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.bracket-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

.bracket-column-header {
  text-align: center;
  padding: 0.5rem 0.6rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  margin-bottom: 1.25rem;
}
.bracket-column-header h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-lime);
}
.bracket-column-header span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bracket-matches-list {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-grow: 1;
  gap: 1.25rem;
}

/* Champion Trophy Box */
.final-champion-card {
  margin-top: 1.25rem;
  padding: 1.25rem 1rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(16, 185, 129, 0.15));
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.champion-trophy {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.champion-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  font-weight: 800;
}

.champion-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.2rem;
}

/* ==========================================================================
   ROUND ROBIN (1ª CLASSE DUPLAS)
   ========================================================================== */

.round-robin-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .round-robin-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.section-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .section-panel { padding: 1.5rem; }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.6rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
  min-width: 320px;
}

.standings-table th {
  padding: 0.6rem 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  border-bottom: 1px solid var(--border-medium);
}

.standings-table td {
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #000; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }

.team-cell {
  font-weight: 600;
  color: #fff;
  font-size: 0.82rem;
}

.numeric-cell {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
}

.highlight-points {
  color: var(--accent-lime);
  font-weight: 800;
  font-size: 0.95rem;
}

.rr-matches-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rr-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rr-match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--accent-lime);
  font-weight: 700;
}

.rr-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rr-team {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.rr-team.is-winner {
  color: var(--accent-lime);
  font-weight: 700;
}
.rr-team-right { text-align: right; }

.rr-score-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.score-input {
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
}
.score-input:focus {
  outline: none;
  border-color: var(--accent-neon);
}

/* ==========================================================================
   SCHEDULE VIEW (AGENDA GERAL)
   ========================================================================== */

.schedule-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .schedule-filters {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
  }
}

.day-filter-pills {
  display: flex;
  overflow-x: auto;
  gap: 0.4rem;
  scrollbar-width: none;
}
.day-filter-pills::-webkit-scrollbar { display: none; }

.day-pill {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.day-pill.active {
  background: var(--accent-neon);
  color: #012419;
  font-weight: 700;
  border-color: var(--accent-neon);
}

.category-select-filter {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
@media (min-width: 640px) {
  .category-select-filter { width: auto; }
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-day-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.timeline-day-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-lime);
  text-transform: uppercase;
}
.timeline-day-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 680px) {
  .schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  }
}

.schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.schedule-time-badge {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-lime);
  font-size: 0.82rem;
}

.schedule-cat-badge {
  padding: 0.15rem 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-accent);
}

.schedule-players {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.2rem 0;
}

.schedule-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.schedule-vs-divider {
  font-size: 0.65rem;
  text-align: center;
  color: var(--text-dim);
  font-weight: 800;
}

.schedule-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   MODAL (PLAYER PROFILE)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end; /* bottom sheet on mobile */
  justify-content: center;
  z-index: 150;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}

.modal-overlay.active { display: flex; }

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: var(--radius-lg);
    animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-header { margin-bottom: 1rem; }
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.modal-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sponsors */
.sponsors-section {
  margin-top: 3rem;
  padding: 1.75rem 1rem;
  background: linear-gradient(180deg, rgba(7, 23, 14, 0.5) 0%, rgba(3, 10, 6, 0.95) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.sponsors-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-lime);
  margin-bottom: 0.3rem;
}
.sponsors-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .sponsors-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
  }
}

.sponsor-card {
  background: rgba(14, 36, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.sponsor-icon { font-size: 1.4rem; }
.sponsor-name { font-size: 0.78rem; font-weight: 700; color: #fff; }
.sponsor-tag { font-size: 0.65rem; color: var(--text-dim); }

/* Footer */
.app-footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.app-footer p strong { color: var(--accent-lime); }

/* Mobile Floating Quick Bar */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 23, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-medium);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0.5rem 0.75rem;
  z-index: 100;
}

@media (min-width: 768px) {
  .mobile-bottom-bar { display: none; }
}

.bottom-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
.bottom-bar-btn.active {
  color: var(--accent-lime);
}
.bottom-bar-btn .bar-icon {
  font-size: 1.15rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 4.5rem; /* Above bottom bar */
  left: 1rem;
  right: 1rem;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-container {
    bottom: 2rem;
    left: auto;
    right: 2rem;
    max-width: 360px;
  }
}
