/* ===================================================================
   IJCNN 2026 Challenge — Light Academic Theme
   =================================================================== */

/* --- Scroll reveal ------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reset & base -------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Dark scrollbar for code blocks */
pre::-webkit-scrollbar-thumb {
  background: var(--gray-600);
}
pre::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
pre {
  scrollbar-color: var(--gray-600) transparent;
}

:root {
  --primary: #1a56db;
  --primary-light: #e8eefb;
  --primary-dark: #133ea0;
  --accent: #0e9f6e;
  --accent-light: #def7ec;
  --danger: #e02424;
  --danger-light: #fde8e8;
  --warning: #c27803;
  --warning-light: #fdf6b2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.65;
  text-align: justify;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  font-size: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* --- Layout -------------------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: 500px;
}
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--gray-500);
}

/* --- Navbar -------------------------------------------------------- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
section[id] {
  scroll-margin-top: 64px;
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
}
.nav-brand:hover {
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-links a {
  color: var(--gray-600);
  font-size: 0.88rem;
  transition: color 0.25s;
}
.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--primary);
}
.nav-links .btn {
  color: var(--white);
}
.nav-links .btn-outline {
  color: var(--primary);
}
.nav-team {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

/* --- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 0.95rem;
  padding: 0.55rem 1.25rem;
  transition: var(--transition);
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-sm {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
}
.btn-lg {
  font-size: 1.05rem;
  padding: 0.7rem 1.75rem;
}
.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.btn-outline:hover {
  background: var(--gray-100);
}
.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover {
  background: #0c8a5e;
}

/* --- Flash messages ------------------------------------------------ */
.flash-container {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1.5rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.flash-success {
  background: var(--accent-light);
  color: #046c4e;
}
.flash-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.flash-warning {
  background: var(--warning-light);
  color: var(--warning);
}
.flash-info {
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Hero ---------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0f2440 100%);
  padding: 5rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
}

/* Network canvas */
#hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Soft glow overlay at bottom */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, #0f172a, transparent);
  z-index: 1;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 2;
}

/* Hero logos */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.hero-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px;
}
.hero-logo-sm {
  height: 75px;
}
.hero-logo-ura {
  height: 75px;
  width: 75px;
  padding: 6px;
  object-fit: contain;
}

.hero h1 {
  font-size: 2.8rem;
  color: #ffffff;
  margin-bottom: 0.1rem;
  letter-spacing: 0.04em;
}
.hero-overline {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #60a5fa;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 1.5rem;
}
.hero-sub a {
  color: #60a5fa;
}
.hero-sub a:hover {
  color: #93bbfd;
}
.hero-publish {
  font-size: 0.95rem;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 1.25rem;
}
.hero-publish a {
  color: #60a5fa;
}
.hero-publish a:hover {
  color: #93bbfd;
}
.hero-challenge-name {
  font-size: 1.35rem;
  color: rgba(203, 213, 225, 0.95);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.hero-status {
  margin-bottom: 1.5rem;
  display: inline-block;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.hero .btn {
  margin-top: 0.5rem;
}
.hero-coi {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.6);
  margin-top: 1.25rem;
}
.coi-note {
  font-size: 0.85rem;
  color: #f87171;
  margin-top: 0.75rem;
}
.hero .btn-outline {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}
.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Badges -------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}
.badge-upcoming {
  background: var(--warning-light);
  color: var(--warning);
}
.badge-active {
  background: var(--accent-light);
  color: #046c4e;
}
.badge-ended {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* --- Sections ------------------------------------------------------ */
.section {
  padding: 2.5rem 0;
}
.section-alt {
  background: var(--white);
}
.section h2 {
  font-size: 1.75rem;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
  padding-bottom: 0.2rem;
  border-bottom: 3px solid var(--primary);
  text-align: left;
  display: inline-block;
}
.section h3 {
  font-size: 1.3rem;
  color: var(--gray-800);
  margin: 2rem 0 0.75rem;
  text-align: left;
}
.section h4 {
  font-size: 1rem;
  color: var(--gray-700);
  margin: 1.25rem 0 0.5rem;
  text-align: left;
}
.section p {
  margin-bottom: 0.75rem;
}
.section ul {
  margin: 0 0 1rem 1.5rem;
  list-style-type: square;
}
.section li {
  margin-bottom: 0.35rem;
  padding-left: 0.25rem;
}

/* --- Cards --------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}
.card h3 {
  margin-top: 0;
}
.card h4 {
  margin-top: 0.5rem;
}
.card-compact h4 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}
.card-compact p {
  margin-bottom: 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Rules */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.card-do {
  border-left: 4px solid var(--accent);
}
.card-dont {
  border-left: 4px solid var(--danger);
}

/* --- Tables -------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
th,
td {
  padding: 0.5rem 0.75rem;
  text-align: justify;
  border-bottom: 1px solid var(--gray-200);
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
}
.table-timeline {
  table-layout: fixed;
  width: 100%;
}
.table-timeline th:first-child,
.table-timeline td:first-child {
  width: 3rem;
}
.table-timeline th:last-child,
.table-timeline td:last-child {
  width: 14rem;
  white-space: nowrap;
}
.table-timeline details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray-800);
}
.table-timeline details summary::-webkit-details-marker {
  display: none;
}
.table-timeline details summary::before {
  content: "▸";
  font-size: 0.75rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  display: inline-block;
}
.table-timeline details[open] summary::before {
  transform: rotate(90deg);
}
.table-timeline details .timeline-desc {
  margin: 0.4rem 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.55;
}
.timeline-highlight {
  background: rgba(37, 99, 235, 0.06);
}
.timeline-highlight td {
  color: var(--primary);
  font-weight: 600;
}
.date-old {
  color: rgba(148, 163, 184, 0.65);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-weight: 400;
  margin-right: 0.35rem;
}
.table-eval td:first-child,
.table-eval th:first-child {
  white-space: nowrap;
}
tbody tr:hover {
  background: transparent;
}

/* --- Code blocks --------------------------------------------------- */
pre {
  background: var(--gray-900);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  white-space: pre;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: break-all;
}
pre code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Auth / login -------------------------------------------------- */
.auth-form {
  margin-top: 1rem;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--gray-700);
  font-size: 0.95rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--white);
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

/* --- Challenge page ------------------------------------------------ */
.status-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-active {
  background: var(--accent-light);
  color: #046c4e;
}
.status-active .status-dot {
  background: var(--accent);
}
.status-upcoming {
  background: var(--warning-light);
  color: var(--warning);
}
.status-upcoming .status-dot {
  background: var(--warning);
}
.status-ended {
  background: var(--gray-100);
  color: var(--gray-500);
}
.status-ended .status-dot {
  background: var(--gray-400);
}

.challenge-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gray-200);
}
.challenge-tab {
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-500);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.challenge-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.challenge-tab:hover {
  color: var(--primary);
}

.challenge-header {
  margin-bottom: 1.5rem;
}
.challenge-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

/* Submit panel */
.submit-panel {
  margin-top: 1rem;
  border: 2px dashed var(--gray-300);
  background: var(--gray-50);
}
.submit-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.submit-success {
  background: var(--accent-light);
  color: #046c4e;
}
.submit-error {
  background: var(--danger-light);
  color: var(--danger);
}

.similarity-bar-wrap {
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
  height: 26px;
}
.similarity-bar {
  height: 100%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 40px;
  transition: width 0.6s ease;
}

/* --- Footer -------------------------------------------------------- */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.footer-sub {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  color: var(--gray-400);
}

/* --- Responsive ---------------------------------------------------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  .rules-grid {
    grid-template-columns: 1fr;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .nav-links.open {
    display: flex;
  }
  /* Hero CTA buttons stack vertically on mobile */
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  .challenge-actions {
    flex-direction: column;
  }

  /* --- Responsive tables → stacked cards --- */
  .table-responsive,
  .table-responsive thead,
  .table-responsive tbody,
  .table-responsive tr,
  .table-responsive th,
  .table-responsive td {
    display: block;
  }
  .table-responsive thead {
    display: none;
  }
  .table-responsive tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0;
    background: var(--white);
  }
  .table-responsive td {
    padding: 0.35rem 0.75rem;
    border-bottom: none;
    text-align: left;
  }
  .table-responsive td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
  }
  /* Hide the # label for timeline (redundant on mobile) */
  .table-timeline td[data-label="#"] {
    display: none;
  }
  .table-timeline tr {
    padding: 0;
  }
  .table-timeline tr.timeline-highlight {
    background: rgba(37, 99, 235, 0.08);
    border: 2px solid var(--primary);
  }
  .table-timeline td[data-label="Date"] {
    font-size: 0.9rem;
    color: var(--gray-600);
  }
  .table-eval td:first-child {
    white-space: normal;
  }
  pre {
    font-size: 0.8rem;
  }
}

/* --- Admin panel --------------------------------------------------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.admin-toolbar h3 {
  margin: 0;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--white);
  transition: var(--transition);
}
.admin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}
.admin-input-sm {
  max-width: 100px;
}

.admin-actions {
  white-space: nowrap;
}
.admin-actions .btn {
  margin-right: 0.25rem;
}

.admin-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.75rem;
}

.btn-danger-text {
  color: var(--danger) !important;
}
.btn-danger-text:hover {
  background: var(--danger-light) !important;
}

.text-success {
  color: var(--accent);
}
.text-danger {
  color: var(--danger);
}

/* --- Chairman review cards ---------------------------------------- */
.review-card {
  margin-bottom: 1.25rem;
}
.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}
.review-card-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.form-group-inline {
  flex: 0 0 auto;
  min-width: 120px;
}
.form-group-inline label {
  font-size: 0.8rem;
}
.form-group-inline input {
  max-width: 140px;
}
.form-group-wide {
  flex: 1 1 100%;
  min-width: 200px;
}
.form-group-wide textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  resize: vertical;
}
.review-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Form select styling */
select.admin-input,
select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--white);
}

@media (max-width: 768px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .review-card-header {
    flex-direction: column;
  }
  .review-card-fields {
    flex-direction: column;
  }
  .form-group-inline input {
    max-width: 100%;
  }
}

/* ----- Live participation stats ----- */
.stats-header {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stats-header h2 {
  margin-bottom: 0;
}
.stats-header .live-pill {
  margin-bottom: 0.4rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 2.5rem;
}
.stat-card {
  position: relative;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #60a5fa);
  background-size: 200% 100%;
  animation: stat-bar-shimmer 4s linear infinite;
}
@keyframes stat-bar-shimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px -12px rgba(37, 99, 235, 0.25);
}
.stat-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}
.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-label {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--gray-600, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stats-charts {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.stats-chart {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  padding: 1.25rem 0.75rem 1rem 0;
}
.stats-chart h3 {
  margin: 0 0 1rem;
  padding-left: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1f2937);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stats-chart h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, #2563eb, #7c3aed);
  border-radius: 2px;
}
.bar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  opacity: 0;
  animation: bar-in 0.5s ease forwards;
}
@keyframes bar-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.bar-name {
  color: var(--text, #1f2937);
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: left;
}
.bar-abbr {
  color: var(--gray-600, #64748b);
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.bar-track {
  position: relative;
  height: 10px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.35);
}
.bar-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary);
  min-width: 2.5rem;
  text-align: right;
  font-size: 0.9rem;
}
.bar-empty {
  color: var(--gray-600, #64748b);
  font-style: italic;
  padding: 0.5rem 0;
}
.stats-updated {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--gray-600, #94a3b8);
  text-align: right;
  font-style: italic;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stats-charts {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 1.25rem 0.75rem 1rem;
  }
  .stat-num {
    font-size: 1.9rem;
  }
  .bar-row {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.9fr) auto;
    font-size: 0.82rem;
    gap: 0.6rem;
  }
  .stats-header {
    flex-wrap: wrap;
  }
}
