:root {
  --primary: #FF6500;
  --secondary: #1E3E62;
  --background: #0B192C;
  --surface: #1e293b;
  --text: #f8fafc;
  --border: rgba(248, 250, 252, 0.1);
  --glow: 0 0 7px #0B192C;
}

body {
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

.container-fluid {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.5s ease-out;
}

.score-container {
  background: linear-gradient(180deg,var(--surface), var(--background));
  border: 2px solid var(--background);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  min-height: 200px;
  gap: 0.5rem;
}

.score-container.winning {
  border-color: var(--primary);
  box-shadow: var(--glow);
  animation: pulseWin 1s infinite;
}

.team-name {
  font-size: clamp(0.75rem, 4vw,1.125rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  width: 100%;
  padding: 0 0.75rem;
  word-wrap: break-word;
  hyphens: auto;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  margin: 0;
}

.nomatch-message{
  font-size: clamp(0.75rem, 4vw,1.125rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: center;
  width: 100%;
  padding: 0 0.75rem;
  word-wrap: break-word;
  hyphens: auto;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  margin: 0;
}

.display-1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--primary);
  text-shadow: var(--glow);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0;
  padding: 0.5rem 0;
}

.point-difference {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: var(--secondary);
  color: var(--text);
  padding: 0.1rem 0.3rem;
  border-radius: 9px;
  font-size: 0.97rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
}

.winning .point-difference {
  opacity: 1;
  transform: translateY(0);
}

.table {
  margin: 0;
  background: var(--background);
  font-size: 0.875rem;
}

.table th {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding: 0.75rem;
}

.table td {
  padding: 0.75rem;
  border-color: var(--border);
}

.table td.higher-score {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  font-weight: bold;
}

.input-group {
  gap: 0.5rem;
}

.input-group .form-control {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.btn {
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-outline-info {
    border: 1px solid var(--primary);
    color: var(--primary);
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #0E1525;
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);;
    --bs-btn-focus-shadow-rgb: 39, 185, 214;
    --bs-btn-active-color: #0E1525;
    --bs-btn-active-bg: var(--primary);
    --bs-btn-active-border-color: var(--primary);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(14, 21, 37, .125);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--primary);
    --bs-gradient: none
}

.btn:hover {
}

.sticky-nav {
  margin-left: 15px;
  margin-right: 15px;
  background: var(--background);
  box-shadow: var(--glow);
}

.spacer{
  height: 90px;
}

.btn .fa-sync-alt {
  transition: transform 0.4s ease-in-out;
}

.btn:active .fa-sync-alt {
  transform: rotate(180deg);
}

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

#loadingSpinner .spinner-border {
  animation: spin 0.8s linear infinite;
}

@keyframes pulseWin {
  0% { box-shadow: 0 0 0 0 rgba(248, 115, 22, 0.4); } /* Color primario */
  70% { box-shadow: 0 0 0 20px rgba(248, 115, 22, 0); } /* Color primario */
  100% { box-shadow: 0 0 0 0 rgba(248, 115, 22, 0); } /* Color primario */
}

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

@media (max-width: 576px) {
  .container-fluid { padding: 0.5rem; }
  .card-body { padding: 0.75rem; }
  .team-name { font-size: 1rem; }
  .display-1 { font-size: 3.5rem; }
  .score-container { padding: 1rem; }
  .table { font-size: 0.75rem; }
  .table td, .table th { padding: 0.5rem; }
  .btn { padding: 0.5rem 1rem; }
}

@media (min-width: 768px) {
  .container-fluid { padding: 1.5rem; }
  .display-1 { font-size: 5rem; }
}

.match-info .badge {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  color: var(--primary);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 10%, transparent);
  min-width: 5rem;
  width: 5rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.player-stats.mt-3 {
  margin-top: 1rem;
}

.max-fouls {
  color: #dc3545 !important;
  font-weight: bold;
}

.player-stats .d-flex {
  flex-direction: column;
  gap: 0.5rem;
}

.player-stats .input-group {
  gap: 0.5rem;
  width: 100%;
}

.player-stats .btn-group {
  width: fit-content;
  margin-left: auto;
}

.team-fouls {
  margin-top: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.team-fouls .badge {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--primary);
  transition: background-color 0.3s ease;
}

.team-fouls .badge.danger {
  background: #dc3545;
}

@media (max-width: 576px) {
  .team-fouls .badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
  }
}

.period-time {
    margin-top: 0.5rem;
}

.period-time .badge {
    background: color-mix(in srgb, var(--primary) 15%, var(--surface));
    color: var(--primary);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 10%, transparent);
    min-width: 5rem;
    width: 5rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}

@media (max-width: 576px) {
    .period-time .badge {
        font-size: 1rem;
        padding: 0.25rem 0.5rem;
    }
}

.btn-autorefresh {
  position: relative;
  border: none;
  background: none;
  transition: color 0.3s ease, transform 0.3s ease; /* Transiciones suaves */
  display: flex;
  align-items: center; /* Alinear icono y contador */
}

.btn-autorefresh:hover {
  transform: scale(1.05); /* Efecto de hover */
}

/* Estilo para cuando el botón está activo */
.btn-autorefresh.active {
  color: var(--primary);
  font-weight: bold; /* Hacer el texto más grueso */
}

#autoRefreshCounter {
  font-weight: bold;
  color: none;
  background: none;
  padding: 0;
  margin-left: 0.5rem;
  width: 3rem; /* Ancho fijo */
  text-align: center;
  transition: opacity 0.3s ease; /* Suave aparición del contador */
}