/* ================= GLOBAL SETTINGS & DESIGN TOKENS ================= */
:root {
  --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Colors */
  --bg-dark: #090d16;
  --bg-card: rgba(20, 30, 48, 0.7);
  --bg-card-hover: rgba(28, 41, 66, 0.85);
  --bg-input: #121c2e;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  
  --primary: #10b981;      /* Emerald Green */
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-hover: #34d399;
  
  --secondary: #6366f1;    /* Indigo */
  --secondary-hover: #818cf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --live: #f43f5e;
  
  /* Shadows & Glassmorphism */
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glow-shadow: 0 0 20px 0 rgba(16, 185, 129, 0.15);
  --glass-backdrop: blur(12px);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= BASE STYLES ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ================= TYPOGRAPHY ================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  color: var(--text-muted);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= UTILITIES ================= */
.hidden {
  display: none !important;
}

.txt-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0d9488);
  color: var(--bg-dark);
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
  background: linear-gradient(135deg, var(--primary-hover), #14b8a6);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background-color: var(--success);
  color: var(--bg-dark);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

/* ================= CARDS ================= */
.card {
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

/* ================= APP HEADER ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(9, 13, 22, 0.8);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-main);
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary-glow));
}

.logo .highlight {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

/* ================= MAIN CONTAINER ================= */
.app-main {
  flex: 1;
  padding: 40px 0;
}

/* ================= TOASTS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background-color: #1e293b;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  color: var(--text-main);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  max-width: 400px;
  transform: translateX(120%);
  animation: slideIn 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

/* ================= HERO SECTION ================= */
.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px auto;
  animation: fadeIn 0.8s ease-out;
}

.hero-lead {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

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

/* ================= EVENTS / LIST SECTION ================= */
.tournaments-section {
  margin-top: 40px;
}

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

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 16px;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input {
  width: 260px;
}

.filter-select {
  cursor: pointer;
}

/* Loading spinner */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: 0 auto;
}

.empty-state svg {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
}

/* Tournaments Grid */
.tournaments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Tournament Card */
.tournament-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.tournament-card:hover {
  transform: translateY(-5px);
  background-color: var(--bg-card-hover);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--glow-shadow);
}

.tc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.tc-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.tc-title {
  font-size: 1.25rem;
  color: var(--text-main);
  line-height: 1.3;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-format {
  background-color: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.badge-status {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-status.live {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  animation: pulseLive 1.5s infinite;
}

.badge-status.finished {
  background-color: rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
}

@keyframes pulseLive {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.tc-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.tc-details-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tc-details-row svg {
  flex-shrink: 0;
}

.tc-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tc-progress-bar {
  flex: 1;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 16px;
}

.tc-progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease-in-out;
}

.tc-progress-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ================= TOURNAMENT CREATOR (WIZARD) ================= */
.create-card {
  max-width: 800px;
  margin: 0 auto;
}

.create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.steps-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-indicator {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-indicator.active {
  color: var(--primary);
}

.step-line {
  width: 24px;
  height: 2px;
  background-color: var(--border-color);
}

.form-group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .form-group-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input.text-area {
  resize: vertical;
}

.select-emoji {
  cursor: pointer;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Wizard Step 2: Teams Setup */
.teams-setup-desc {
  margin-bottom: 24px;
  padding: 12px 16px;
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.team-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
}

.team-emoji-select {
  width: 60px;
  text-align: center;
  font-size: 1.2rem;
  padding: 9px 0;
  cursor: pointer;
}

.team-name-input {
  flex: 1;
}

.teams-container {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.teams-container .sub-title {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.teams-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  min-height: 100px;
}

.no-teams-placeholder {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  height: 100px;
}

.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: var(--transition);
  animation: scaleUp 0.2s forwards ease-out;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.team-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-item-emoji {
  font-size: 1.3rem;
}

.team-item-name {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn-remove-team {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-remove-team:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Wizard Step 3: Success Screen */
.success-screen {
  text-align: center;
  padding: 30px 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.success-screen h2 {
  margin-bottom: 12px;
}

.success-screen p {
  margin-bottom: 30px;
}

.admin-key-box {
  background-color: rgba(16, 185, 129, 0.05);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 550px;
  margin: 0 auto 36px auto;
  text-align: left;
}

.key-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.key-display-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.key-display-row code {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 1.05rem;
  color: var(--primary);
  word-break: break-all;
}

.key-warning {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ================= TOURNAMENT VIEW ================= */
.tournament-detail-header {
  margin-bottom: 30px;
}

.td-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.td-icon-name {
  display: flex;
  align-items: center;
  gap: 20px;
}

.td-emoji {
  font-size: 3.5rem;
  line-height: 1;
}

.td-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

.td-description {
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--text-main);
  border-left: 3px solid var(--primary);
  padding-left: 14px;
}

/* Admin badge / controller state */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

/* Stats summary */
.tournament-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.stat-box {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  display: block;
}

/* ================= TAB SYSTEM ================= */
.tab-navigation {
  display: flex;
  gap: 10px;
  padding: 8px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
}

.tab-btn {
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 1;
  transition: var(--transition);
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.tab-btn.active {
  background-color: var(--primary);
  color: var(--bg-dark);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.tab-title {
  margin-bottom: 20px;
  font-size: 1.4rem;
}

/* ================= STANDINGS TABLE ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

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

.standings-table th, .standings-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.standings-table th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.standings-table tbody tr {
  transition: var(--transition);
}

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

.standings-table .team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.standings-table .team-emoji {
  font-size: 1.25rem;
}

.standings-table tr.top-team {
  background-color: rgba(16, 185, 129, 0.03);
}

.standings-table tr.top-team td.font-bold {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.standings-table .rank-num {
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ================= MATCHES / SCHEDULE ================= */
.matches-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.round-selector-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  max-width: 100%;
}

.round-btn {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.round-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.round-btn.active {
  background-color: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.matches-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

@media (max-width: 500px) {
  .matches-list-grid {
    grid-template-columns: 1fr;
  }
}

/* Match Card */
.match-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}

.match-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mc-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-status.live {
  color: var(--live);
  font-weight: 700;
}

.mc-status.finished {
  color: var(--success);
}

.mc-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--live);
  border-radius: 50%;
  animation: pulseDot 1.2s infinite;
}

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

.mc-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mc-team {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 40%;
}

.mc-team.team-away {
  justify-content: flex-end;
  text-align: right;
}

.mc-team-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.mc-team-name {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-score-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 20%;
  font-family: var(--font-heading);
}

.mc-score {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-score.score-empty {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.mc-vs {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mc-events {
  margin-top: 10px;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mc-events-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mc-events-list {
  list-style: none;
  width: 50%;
}

.mc-events-list.away-events {
  text-align: right;
}

.mc-events-list li {
  margin-bottom: 4px;
}

.scorer-icon {
  margin-right: 4px;
}

.mc-events-list.away-events .scorer-icon {
  margin-right: 0;
  margin-left: 4px;
}

.mc-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.btn-edit-match {
  width: 100%;
}

/* ================= TOURNAMENT BRACKET ================= */
.bracket-scroll-container {
  overflow-x: auto;
  padding: 20px 0;
  width: 100%;
}

.bracket-wrapper {
  display: flex;
  gap: 40px;
  min-width: max-content;
  padding: 20px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 260px;
}

.bracket-round-title {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 20px;
}

.bracket-matches {
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: 100%;
  justify-content: space-around;
}

.bracket-match {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  position: relative;
}

.bracket-match:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.bm-info {
  background-color: rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
}

.bm-info.live {
  color: var(--live);
}

.bm-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.bm-team-row:last-child {
  border-bottom: none;
}

.bm-team-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  max-width: 75%;
}

.bm-team-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-team-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  min-width: 24px;
  text-align: center;
}

.bm-team-row.winner {
  color: var(--primary);
  font-weight: 600;
}

.bm-team-row.winner .bm-team-score {
  background-color: var(--primary);
  color: var(--bg-dark);
}

.bm-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.bracket-match:hover .bm-edit-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Bracket connection lines (rendered dynamically or stylized) */
/* For this system, we layout rounds horizontally and align them vertically. */

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 7, 12, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

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

.modal-card {
  background-color: #0f1a30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-card-sm {
  max-width: 400px;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

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

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

.modal-body {
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Score editor in modal */
.score-editor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 24px;
}

.score-team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 40%;
}

.team-emoji-large {
  font-size: 3rem;
}

.team-name-large {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.score-input {
  width: 70px;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  padding: 6px;
}

.score-vs-divider {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* Scorers list */
.scorers-section {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 20px;
}

.scorers-section h4 {
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.scorers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.scorer-input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.input-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.minute-input {
  width: 60px;
}

.scorers-list {
  list-style: none;
  font-size: 0.85rem;
  max-height: 100px;
  overflow-y: auto;
}

.scorer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background-color: rgba(255, 255, 255, 0.03);
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
}

.btn-delete-scorer {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-scorer:hover {
  color: var(--danger);
}

/* ================= FOOTER ================= */
.app-footer {
  background-color: rgba(9, 13, 22, 0.9);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ================= DRAG & DROP & TIMELINE STYLES ================= */
.draw-workspace {
  display: flex;
  gap: 30px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.draw-teams-side {
  flex: 1;
  min-width: 320px;
}
.draw-schedule-side {
  flex: 1.2;
  min-width: 360px;
}
.draw-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.draw-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.draw-group-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.draw-group-box h5 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}
.draw-teams-dropzone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}
.draggable-team {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: var(--transition);
}
.draggable-team:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.04);
}
.draggable-team.dragging {
  opacity: 0.4;
  border: 1px dashed var(--primary);
}

/* Timeline break elements */
.draw-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 8px;
}
.timeline-match-row {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.tm-time-pitch {
  font-weight: 700;
  color: var(--primary);
  min-width: 130px;
}
.tm-teams {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.timeline-break-card {
  background-color: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timeline-break-card span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-delete-break {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}
.btn-delete-break:hover {
  color: var(--danger);
}

.btn-add-break-trigger {
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-add-break-trigger:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background-color: rgba(16, 185, 129, 0.05);
}

.timeline-break-public {
  grid-column: 1 / -1;
  background-color: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

/* Vekové kategórie a Hľadanie tímov badgy */
.badge-category {
  background-color: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-status.looking {
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--warning);
}

/* Banner: Hľadá sa tím v detaile turnaja */
.looking-teams-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.02) 100%);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--warning);
  font-weight: 500;
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0px rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.1); }
  100% { box-shadow: 0 0 0px rgba(245, 158, 11, 0); }
}

/* Veľký admin modál pre úpravy */
.modal-card.modal-card-lg {
  max-width: 900px;
  width: 95%;
}

.admin-edit-scroll-container {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 12px;
  margin-bottom: 10px;
}

/* Prispôsobenie scrollbaru pre modál */
.admin-edit-scroll-container::-webkit-scrollbar {
  width: 6px;
}
.admin-edit-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}
.admin-edit-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.admin-edit-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.admin-edit-section h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ================= SPONSORS AND PARTNERS ================= */
.sponsor-item-link {
  transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
  cursor: pointer;
  display: inline-flex;
}
.sponsor-item-link:hover {
  transform: translateY(-2px) scale(1.05);
}
.sponsor-fallback {
  transition: border-color 0.2s, background-color 0.2s;
}
.sponsor-fallback:hover {
  border-color: var(--primary) !important;
  background: rgba(0, 168, 204, 0.1) !important;
}

/* ================= LOGÁ TÍMOV ================= */
.team-logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
  background-color: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: inline-block;
  margin-right: 6px;
}

.standings-table .team-logo-img {
  width: 20px;
  height: 20px;
}

.mc-team .team-logo-img {
  width: 26px;
  height: 26px;
  margin: 0;
}

.bracket-match .team-logo-img {
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

.team-item .team-logo-img {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}
