:root {
  --primary: #0d6efd;
  --gold: #ffc107;
  --dark-bg: #1a1a2e;
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, #0d6efd 0%, #1a1a2e 60%, #16213e 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
}
.hero-brand {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(90deg, #ffc107, #fff, #ffc107);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite;
}
@keyframes shine {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Result Cards */
.result-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(13,110,253,.18) !important;
}
.result-card .card-header {
  background: linear-gradient(135deg, #0d6efd, #1a1a2e);
  color: #fff;
  padding: 1rem 1.25rem;
}
.result-card .loteria-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
}
.result-card .numero-ganador {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
  font-family: 'Courier New', monospace;
}
.hora-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 20px;
  padding: .15rem .6rem;
  letter-spacing: .02em;
}
.fecha-display {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  text-transform: capitalize;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.prize-badge {
  background: linear-gradient(135deg, #198754, #20c997);
  color: #fff;
  border-radius: 8px;
  padding: .45rem .9rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.prize-badge.silver {
  background: linear-gradient(135deg, #6c757d, #adb5bd);
}
.prize-badge.bronze {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
}
.prize-badge.extra-purple {
  background: linear-gradient(135deg, #6f42c1, #a07fd1);
}
.prize-badge.extra-teal {
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
}
.prize-badge.extra-pink {
  background: linear-gradient(135deg, #d63384, #f06292);
}
.prize-badge.extra-indigo {
  background: linear-gradient(135deg, #3730a3, #6366f1);
}
.prize-badge.extra-cyan {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}
.prizes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

/* Lottery gallery cards */
.loteria-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  height: 100%;
}
.loteria-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,.12) !important;
}
.loteria-card .loteria-banner {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: linear-gradient(135deg, #0d6efd22, #1a1a2e22);
}
.loteria-placeholder-img {
  height: 150px;
  background: linear-gradient(135deg, #0d6efd, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: rgba(255,255,255,.5);
}

/* Filter buttons */
.filter-btn {
  border-radius: 20px;
  font-size: .85rem;
}

/* Filter select */
.filter-select-wrap {
  position: relative;
}
.filter-select-wrap::after {
  content: '\F282';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 1rem;
  pointer-events: none;
}
.filter-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(135deg, #0d6efd, #1a1a2e);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .55rem 2.5rem .55rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(13,110,253,.3);
  transition: box-shadow .2s;
}
.filter-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13,110,253,.35);
}
.filter-select option {
  background: #1a1a2e;
  color: #fff;
  font-weight: 500;
}

/* Admin styles */
.admin-sidebar {
  min-height: 100vh;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  width: 260px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.75);
  border-radius: 8px;
  margin: 2px 0;
  padding: .6rem 1rem;
  transition: all .2s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.admin-sidebar .nav-link i {
  width: 22px;
}
.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  background: #f8f9fa;
  transition: margin .3s;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.section-panel {
  display: none;
}
.section-panel.active {
  display: block;
}

/* Table */
.table-hover tbody tr:hover { background: #f0f4ff; }

/* Image preview */
#imgPreview {
  max-width: 160px;
  max-height: 120px;
  border-radius: 10px;
  object-fit: cover;
  display: none;
  border: 2px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .numero-ganador { font-size: 1.8rem !important; }
}

/* Badges de estado */
.badge-activa {
  background: #198754;
  color: #fff;
  border-radius: 20px;
  padding: .3em .8em;
  font-size: .78rem;
}
.badge-inactiva {
  background: #6c757d;
  color: #fff;
  border-radius: 20px;
  padding: .3em .8em;
  font-size: .78rem;
}

/* Ticket style for result number */
.ticket-display {
  background: linear-gradient(135deg, #1a1a2e, #0d3460);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ticket-display::before,
.ticket-display::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  background: #f8f9fa;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.ticket-display::before { left: -15px; }
.ticket-display::after { right: -15px; }

/* Loading shimmer */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Toast */
.toast-container { z-index: 9999; }

/* En Vivo blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Disclaimer */
.disclaimer-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #dee2e6;
  border-left: 5px solid #6c757d;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.disclaimer-icon {
  font-size: 2rem;
  color: #6c757d;
  flex-shrink: 0;
  padding-top: .1rem;
}
.disclaimer-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #495057;
  margin-bottom: .4rem;
}
.disclaimer-text {
  font-size: .82rem;
  color: #6c757d;
  margin-bottom: 0;
  line-height: 1.6;
}
@media (max-width: 576px) {
  .disclaimer-box { flex-direction: column; gap: .75rem; }
}

/* ---- Brand blocks ---- */
.brand-block {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e4e9f0;
  border-left: 5px solid var(--brand-color, #0d6efd);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 14px rgba(0,0,0,.07);
}
.brand-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 2px solid var(--brand-light, #e9ecef);
}
.brand-icon {
  font-size: 1.3rem;
  color: var(--brand-color, #0d6efd);
  flex-shrink: 0;
}
.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-title, #1a1a2e);
  letter-spacing: .01em;
  flex-grow: 1;
}
.brand-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--brand-color, #0d6efd);
  background: var(--brand-light, #e8f0fe);
  border-radius: 20px;
  padding: .25em .85em;
  white-space: nowrap;
}
/* Card headers inherit brand color */
.brand-block .result-card .card-header {
  background: linear-gradient(135deg, var(--brand-color, #0d6efd), #1a1a2e);
}

/* ---- Numbers display ---- */

/* Labeled style: 1°, 2°, 3° — for lotteries with ≤4 numbers */
.nums-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
}
.num-labeled {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 193, 7, 0.15);
  border: 2px solid rgba(255, 193, 7, 0.5);
  border-radius: 12px;
  padding: .45rem .9rem;
  min-width: 4rem;
}
.num-label {
  font-size: .72rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}
.num-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffc107;
  letter-spacing: .06em;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}

/* Chip grid: for lotteries with 5+ numbers */
.nums-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
}
.num-chip {
  background: rgba(255, 193, 7, 0.18);
  color: #ffc107;
  border: 2px solid rgba(255, 193, 7, 0.5);
  border-radius: 10px;
  padding: .25rem .55rem;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.num-chip-serie {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.22);
  font-size: .8rem;
}

/* Historial table variants */
.nums-row-sm {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: center;
}
.num-labeled-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.2rem;
}
.num-label-sm {
  font-size: .58rem;
  color: #adb5bd;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.nums-grid-sm {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  justify-content: center;
}
/* ---- Resultados de HOY (verde) ---- */
.result-card-hoy {
  box-shadow: 0 0 0 2px #20c997, 0 6px 24px rgba(32,201,151,.25) !important;
}
.hoy-badge {
  display: inline-block;
  background: rgba(32, 201, 151, 0.25);
  color: #20c997;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 20px;
  padding: .15rem .6rem;
  letter-spacing: .06em;
  animation: blink 1.4s ease-in-out infinite;
}
.num-labeled.num-hoy {
  background: rgba(32, 201, 151, 0.15);
  border-color: rgba(32, 201, 151, 0.55);
}
.num-labeled.num-hoy .num-value {
  color: #20c997;
}
.num-labeled.num-hoy .num-label {
  color: rgba(32, 201, 151, 0.75);
}
.num-chip.num-hoy {
  background: rgba(32, 201, 151, 0.15);
  color: #20c997;
  border-color: rgba(32, 201, 151, 0.5);
}
.num-value-hoy {
  color: #20c997 !important;
}

.num-chip-sm {
  font-size: .72rem;
  padding: .12rem .35rem;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  border: 1px solid rgba(13, 110, 253, 0.28);
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
