/* ══════════════════════════════════════════════════════════════
   BALLBALL Tech Console — Black & White Minimal v2
   ══════════════════════════════════════════════════════════════ */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Inter', sans-serif;
  --font-title: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --bg: #000;
  --bg-elevated: #080808;
  --bg-card: #060606;
  --bg-card-hover: #0c0c0c;
  --bg-input: #0a0a0a;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(255, 255, 255, 0.3);
  --text-primary: #e8e8e8;
  --text-secondary: rgba(255, 255, 255, 0.45);
  --text-tertiary: rgba(255, 255, 255, 0.25);
  --accent: #fff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
  --transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--text-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

::selection { background: rgba(255,255,255,0.15); }

/* Remove ambient glow */
.glow { display: none; }

/* ── App Frame ────────────────────────────────────────────── */
.app-frame {
  position: relative;
  min-height: 100vh;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  height: 56px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-title);
  font-weight: 900;
  font-style: italic;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.topbar__brand:hover { color: #fff; }

.topbar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
  font-size: 14px;
  color: #000;
}

.topbar__nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Main Content ─────────────────────────────────────────── */
.app-content {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── Page Transitions ─────────────────────────────────────── */
.page-enter {
  opacity: 0;
  transform: translateY(8px);
}
.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
}
.page-header h1 {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
  text-transform: uppercase;
}
.page-header p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.page-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.refresh-status {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.card--no-hover:hover {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
  transform: none;
}

/* ── Hero / Dashboard ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 72px 0 56px;
}
.hero h1 {
  font-family: var(--font-title);
  font-size: 44px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.1;
  text-transform: uppercase;
}
.hero p {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 48px;
}

.metric-card {
  text-align: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.metric-card__value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.metric-card__label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.feature-card {
  display: block;
  padding: 28px 24px;
  color: var(--text-primary);
  cursor: pointer;
}
.feature-card:hover { color: var(--text-primary); }
.feature-card__icon {
  font-size: 24px;
  margin-bottom: 14px;
  opacity: 0.9;
}
.feature-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.feature-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Controls Bar ─────────────────────────────────────────── */
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus {
  border-color: var(--border-focus);
  background: #0e0e0e;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.select-input {
  padding: 10px 36px 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--transition);
}
.select-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

/* ── Data Table ───────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}
.data-table th.sortable:hover { color: var(--text-secondary); }
.data-table th.sorted { color: rgba(255,255,255,0.7); }
.data-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.6;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  transition: background var(--transition);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.data-table .team-link {
  font-weight: 600;
  font-family: var(--mono);
  font-size: 12px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 1px;
  transition: all var(--transition);
}
.data-table .team-link:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}
/* Event strength table: truncate long event names */
.data-table .event-name-cell {
  white-space: normal;
  max-width: 340px;
  line-height: 1.4;
}

.data-table .muted { color: var(--text-secondary); }
.data-table .rank-cell {
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 12px;
}
.data-table .score-cell {
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* Top 3 rank highlights */
.data-table tr[data-rank="1"] .rank-cell { color: #fff; }
.data-table tr[data-rank="2"] .rank-cell { color: rgba(255,255,255,0.8); }
.data-table tr[data-rank="3"] .rank-cell { color: rgba(255,255,255,0.65); }

/* ── Badges / Pills ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge--blue   { background: rgba(255, 255, 255, 0.08); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.1); }
.badge--green  { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255,255,255,0.15); }
.badge--orange { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.6); border-color: rgba(255,255,255,0.08); }
.badge--purple { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.6); border-color: rgba(255,255,255,0.08); }
.badge--red    { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.6); border-color: rgba(255,255,255,0.08); }
.badge--gray   { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); border-color: rgba(255,255,255,0.06); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.pagination__info {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 12px;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}
.btn--primary {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 600;
}
.btn--primary:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.88);
}

/* ── Results Grid ─────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.event-card {
  display: block;
  padding: 20px 22px;
  color: var(--text-primary);
}
.event-card:hover { color: var(--text-primary); }
.event-card__name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.event-card__meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.event-card__badges {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ── Team Profile ─────────────────────────────────────────── */
.profile-header {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 36px;
}
.profile-number {
  font-family: var(--font-title);
  font-size: 44px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.profile-info h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.profile-info p {
  font-size: 14px;
  color: var(--text-secondary);
}
.profile-badges {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.profile-section {
  margin-bottom: 32px;
}
.profile-section__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.skills-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.skills-bar .card { text-align: center; padding: 22px 16px; }
.skills-bar__value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  font-family: var(--mono);
}
.skills-bar__label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ── Qualification Info ──────────────────────────────────── */
.qual-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qual-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.qual-item:hover {
  border-color: var(--border-hover);
}
.qual-item__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  font-size: 14px;
}
.qual-item__content {
  flex: 1;
  min-width: 0;
}
.qual-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qual-item__event {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qual-item__event a {
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.qual-item__event a:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255,255,255,0.3);
}
.qual-item__date {
  flex-shrink: 0;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-tertiary);
}

/* ── Loading State ────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 0;
  color: var(--text-tertiary);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty / Error State ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-secondary);
}
.empty-state__icon { font-size: 32px; margin-bottom: 12px; opacity: 0.6; }
.empty-state__text { font-size: 14px; }

/* ── Skeleton Shimmer ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Rating Bar ──────────────────────────────────────────── */
.rating-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.rating-value {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 36px;
}
.rating-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.rating-bar__fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  transition: width 300ms ease;
}

/* ── Event Detail Info ────────────────────────────────────── */
.event-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.info-item {
  padding: 16px 20px;
  background: var(--bg-card);
}
.info-item__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.info-item__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.event-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.event-stat {
  text-align: center;
  padding: 22px 16px;
}
.event-stat__value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -0.03em;
  color: #fff;
}
.event-stat__label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ── Back Link ────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
  margin-bottom: 4px;
}
.back-link:hover { color: var(--text-primary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; gap: 16px; }
  .topbar__title { display: none; }
  .app-content { padding: 24px 16px 48px; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 30px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; gap: 12px; }
  .profile-number { font-size: 32px; }
  .skills-bar { grid-template-columns: 1fr; }
  .controls { flex-direction: column; }
  .search-input { min-width: 100%; }
  .qual-item { flex-wrap: wrap; }
  .qual-item__date { width: 100%; }
}

/* ── Topbar User Area ────────────────────────────────────── */
.topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__username {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal__header h3 {
  font-size: 16px;
  font-weight: 600;
}
.modal__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal__close:hover { color: #fff; }
.modal__body {
  padding: 20px 24px 24px;
}
.modal__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.modal__tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}
.modal__tab.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: var(--border-hover);
}
.modal__body form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal__error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 18px;
}
.btn--primary {
  background: #fff;
  color: #000;
  font-weight: 600;
}
.btn--primary:hover {
  background: #e0e0e0;
}
.btn--sm {
  padding: 4px 12px;
  font-size: 12px;
  height: auto;
}
.modal__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-tertiary);
  font-size: 12px;
}
.modal__divider::before,
.modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
#uid-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Notes & Favorites ───────────────────────────────────── */
.user-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}
.user-actions {
  margin-bottom: 12px;
}
.btn--fav-active {
  background: rgba(255, 200, 50, 0.15);
  color: #ffc832;
  border-color: rgba(255, 200, 50, 0.3);
}
.btn--fav-active:hover {
  background: rgba(255, 200, 50, 0.25);
}
.note-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition);
}
.note-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}
.note-textarea::placeholder {
  color: var(--text-tertiary);
}
.note-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.note-status {
  color: #4ade80;
  font-size: 13px;
}

/* ── Note Icon Button (inline in tables) ─────────────────── */
.note-icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all var(--transition);
  vertical-align: middle;
  margin-left: 4px;
}
.note-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
}

/* ── Note Popup ──────────────────────────────────────────── */
.note-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  width: 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 12px;
  margin-top: 4px;
}
.note-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.note-popup__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.note-popup__close:hover { color: #fff; }
.note-popup__text {
  min-height: 60px;
  font-size: 13px;
}

/* ── Live Event ──────────────────────────────────────────── */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-transform: uppercase;
}
.live-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: live-pulse 1.5s ease infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.match-progress {
  margin-bottom: 24px;
}
.match-progress__bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.match-progress__fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  transition: width 300ms ease;
}
.match-progress__text {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

/* Match result rows */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 600px;
  overflow-y: auto;
}
.match-row {
  display: grid;
  grid-template-columns: 64px 1fr 56px 56px 1fr;
  gap: 0;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color var(--transition);
}
.match-row:hover {
  border-color: var(--border-hover);
}
.match-row--unscored {
  opacity: 0.4;
}
.match-row__name {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.match-row__alliance {
  font-size: 12px;
  font-family: var(--mono);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-row__alliance--red {
  text-align: right;
  color: #f87171;
}
.match-row__alliance--blue {
  text-align: left;
  color: #60a5fa;
}
.match-row__score {
  text-align: center;
  font-weight: 800;
  font-family: var(--mono);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
}
.match-row__score--red {
  color: #f87171;
}
.match-row__score--blue {
  color: #60a5fa;
}
.match-row__score--winner {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.refresh-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.refresh-bar__status {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--mono);
}

/* ── Upcoming Event Preview ──────────────────────────────── */
.upcoming-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-transform: uppercase;
}

.country-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.country-tag {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

/* Match filter tabs */
.match-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.match-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}
.match-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-hover);
}

/* ── Worlds Page ─────────────────────────────────────────── */
.worlds-countdown {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.worlds-div-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.worlds-div-card {
  display: block;
  padding: 22px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-primary);
}
.worlds-div-card:hover { color: var(--text-primary); }
.worlds-div-card__name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.worlds-div-card__stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

/* Sort toggle */
.sort-toggle { display: flex; gap: 4px; }
.sort-btn { opacity: 0.5; transition: opacity var(--transition); }
.sort-btn.active { opacity: 1; background: rgba(255,255,255,0.12); }
