/* Pro Judo — /test mobile-first home redesign (same palette as site.css) */

.test-home-page {
  --th-bg: #0f172a;
  --th-card: #1e293b;
  --th-border: #334155;
  --th-text: #f8fafc;
  --th-muted: #94a3b8;
  --th-dim: #64748b;
  --th-gold: #fbbf24;
  --th-link: #93c5fd;
  --th-radius: 0.75rem;
  --th-space: 1rem;
  --th-font: 1rem;
  --th-font-sm: 0.875rem;
  --th-font-xs: 0.8125rem;
  --th-font-label: 0.75rem;
  background: var(--th-bg);
  color: var(--th-text);
  font-size: var(--th-font);
  line-height: 1.5;
}

.test-home-page main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 max(0.75rem, env(safe-area-inset-left)) 2rem max(0.75rem, env(safe-area-inset-right));
}

@media (min-width: 1200px) {
  .test-home-page main {
    max-width: 76rem;
  }
}

/* Main + news sidebar (UFC-style on wide screens) */
.th-content-layout {
  display: flex;
  flex-direction: column;
  gap: var(--th-space);
  align-items: stretch;
}

.th-main-col {
  min-width: 0;
  width: 100%;
}

.th-news-sidebar {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1199.98px) {
  .th-news-sidebar {
    padding: 1rem;
    background: var(--th-card);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
  }
}

@media (min-width: 1200px) {
  .th-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 2rem;
    align-items: start;
  }

  .th-news-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-left: 1.25rem;
    border-left: 1px solid var(--th-border);
    background: transparent;
    border-radius: 0;
    border-top: none;
    border-right: none;
    border-bottom: none;
  }
}

.th-sidebar-block {
  margin-bottom: 1.5rem;
}

.th-sidebar-block:last-child {
  margin-bottom: 0;
}

.th-sidebar-heading {
  margin: 0 0 0.75rem;
  font-size: var(--th-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--th-muted);
  line-height: 1.3;
}

.th-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.th-sidebar-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.th-sidebar-item:last-child {
  border-bottom: none;
}

.th-sidebar-item.is-extra {
  display: none;
}

.th-sidebar-block.is-expanded .th-sidebar-item.is-extra {
  display: block;
}

.th-sidebar-time {
  display: block;
  margin-bottom: 0.2rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
  font-variant-numeric: tabular-nums;
}

.th-sidebar-text {
  margin: 0;
  font-size: var(--th-font-sm);
  line-height: 1.45;
  color: var(--th-text);
}

.th-sidebar-text a {
  color: var(--th-text);
  font-weight: 600;
  text-decoration: none;
}

.th-sidebar-text a:hover {
  color: var(--th-link);
  text-decoration: underline;
}

.th-sidebar-event {
  display: block;
  margin-top: 0.25rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
  line-height: 1.3;
}

.th-sidebar-empty {
  margin: 0;
  font-size: var(--th-font-sm);
  color: var(--th-dim);
  line-height: 1.4;
}

.th-sidebar-more {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: var(--th-dim);
  font-size: var(--th-font-sm);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}

.th-sidebar-more:hover {
  color: var(--th-link);
}

/* Hero (video + scrim — same asset as live home) */
.th-hero-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 1rem 0 var(--th-space);
  padding: 1.75rem 1rem 1.5rem;
  text-align: center;
  overflow: hidden;
  border-radius: var(--th-radius);
  border: 1px solid var(--th-border);
  isolation: isolate;
  min-height: 220px;
}

@media (min-width: 768px) {
  .th-hero-wrap {
    min-height: 300px;
    padding: 3rem 1.25rem 2.75rem;
  }
}

@media (min-width: 992px) {
  .th-hero-wrap {
    min-height: 400px;
    padding: 3.75rem 1.5rem 3.25rem;
  }

  .th-hero-title {
    font-size: 2rem;
  }
}

@media (min-width: 1200px) {
  .th-hero-wrap {
    min-height: 480px;
    padding: 4.5rem 1.5rem 4rem;
  }

  .th-hero-title {
    font-size: 2.35rem;
  }
}

.th-hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.th-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(0.85) contrast(1.05);
}

.th-hero-video-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.88) 55%, rgba(15, 23, 42, 0.94) 100%),
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.75));
}

.th-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.th-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.35;
}

.th-orb-1 {
  width: 180px;
  height: 180px;
  background: rgba(56, 189, 248, 0.35);
  top: -30px;
  left: 5%;
}

.th-orb-2 {
  width: 140px;
  height: 140px;
  background: rgba(251, 191, 36, 0.28);
  top: 8%;
  right: 0;
}

.th-orb-3 {
  width: 110px;
  height: 110px;
  background: rgba(34, 197, 94, 0.2);
  bottom: -15px;
  left: 40%;
}

.th-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.th-hero-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--th-text);
}

.th-hero-sub {
  margin: 0 0 0.5rem;
  font-size: var(--th-font-sm);
  color: var(--th-muted);
  line-height: 1.4;
}

.th-hero-tagline {
  margin-bottom: 1rem;
}

.th-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.th-stat {
  flex: 1 1 5.5rem;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  font-size: var(--th-font-sm);
  color: var(--th-muted);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--th-border);
  border-radius: 0.5rem;
  backdrop-filter: blur(4px);
}

.th-stat strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--th-gold);
  font-variant-numeric: tabular-nums;
  min-width: 7.5ch;
  margin: 0 auto 0.15rem;
}

.th-stat [data-count] {
  font-variant-numeric: tabular-nums;
}

.th-tatami-line {
  height: 3px;
  max-width: 120px;
  margin: 1rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--th-gold), #38bdf8, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .th-hero-video-bg {
    display: none;
  }
}

/* Sections */
.th-section {
  margin-bottom: var(--th-space);
}

.th-card {
  padding: 1rem;
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}

.th-section-title {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.th-section-hint {
  margin: 0 0 0.85rem;
  font-size: var(--th-font-sm);
  color: var(--th-muted);
  line-height: 1.4;
}

/* Search */
.th-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--th-font-sm);
  font-weight: 600;
  color: var(--th-text);
}

.th-input,
.th-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: var(--th-font);
  color: var(--th-text);
  background: var(--th-bg);
  border: 1px solid #475569;
  border-radius: 0.5rem;
}

.th-input:focus,
.th-select:focus {
  outline: none;
  border-color: var(--th-muted);
}

.th-search-input {
  width: 100%;
  margin-bottom: 0.75rem;
}

.th-search-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.th-btn-row {
  display: flex;
  gap: 0.5rem;
}

.th-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-size: var(--th-font-sm);
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.th-btn-primary {
  flex: 1;
  color: var(--th-text);
  background: #334155;
  border-color: #475569;
}

.th-btn-primary:hover {
  color: #fff;
  background: #475569;
  border-color: #64748b;
}

.th-btn-ghost {
  color: var(--th-muted);
  background: transparent;
  border-color: #475569;
}

.th-btn-ghost:hover {
  color: var(--th-text);
  border-color: #64748b;
  background: rgba(30, 41, 59, 0.6);
}

.th-btn-outline {
  color: var(--th-text);
  background: rgba(15, 23, 42, 0.45);
  border-color: #475569;
}

.th-btn-outline:hover {
  color: var(--th-link);
  border-color: #64748b;
  background: rgba(30, 41, 59, 0.85);
}

/* Bootstrap loaded on page — keep any legacy btn classes on-theme */
.test-home-page .btn-outline-primary,
.test-home-page .btn-primary {
  color: var(--th-text);
  background: rgba(15, 23, 42, 0.45);
  border-color: #475569;
}

.test-home-page .btn-outline-primary:hover,
.test-home-page .btn-primary:hover {
  color: var(--th-link);
  background: rgba(30, 41, 59, 0.85);
  border-color: #64748b;
}

.test-home-page .btn-outline-secondary {
  color: var(--th-muted);
  border-color: #475569;
  background: transparent;
}

.test-home-page .btn-outline-secondary:hover {
  color: var(--th-text);
  border-color: #64748b;
  background: rgba(30, 41, 59, 0.6);
}

.th-advanced {
  margin-top: 0;
}

.th-search-actions {
  margin-top: 0.85rem;
}

.th-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.th-advanced-grid label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: var(--th-font-xs);
  color: var(--th-muted);
}

.th-advanced-grid .th-select,
.th-advanced-grid .th-input {
  font-size: var(--th-font-sm);
  padding: 0.5rem 0.6rem;
}

.th-advanced-grid > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.th-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.th-results-item {
  border-bottom: 1px solid var(--th-border);
}

.th-results-item:last-child {
  border-bottom: none;
}

.th-results-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: var(--th-text);
  text-decoration: none;
}

.th-results-link:hover {
  color: var(--th-link);
}

.th-results-name {
  font-weight: 600;
  font-size: var(--th-font);
}

.th-results-meta {
  font-size: var(--th-font-xs);
  color: var(--th-muted);
}

.th-elo-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  font-size: var(--th-font-sm);
  font-weight: 700;
  color: var(--th-gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.35rem;
}

.th-athlete-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: baseline;
  white-space: nowrap;
}

.th-active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.28);
  flex-shrink: 0;
  vertical-align: middle;
  animation: none;
}

.th-lb-meta .th-active-dot,
.th-lb-meta .active-marker {
  width: 6px;
  height: 6px;
}

/* Tabs */
.th-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.th-tab {
  flex: 1;
  padding: 0.45rem 0.5rem;
  font-size: var(--th-font-xs);
  font-weight: 600;
  color: var(--th-muted);
  background: var(--th-bg);
  border: 1px solid var(--th-border);
  border-radius: 0.45rem;
  cursor: pointer;
  font-family: inherit;
}

.th-tab.is-active {
  color: var(--th-text);
  background: #334155;
  border-color: #64748b;
}

.th-tab-panel[hidden] {
  display: none !important;
}

/* News feed */
.th-feed-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--th-border);
}

.th-feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.th-feed-time {
  display: block;
  margin-bottom: 0.15rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
  font-variant-numeric: tabular-nums;
}

.th-feed-body {
  margin: 0;
  font-size: var(--th-font-sm);
  line-height: 1.45;
}

.th-feed-body a {
  color: var(--th-text);
  font-weight: 600;
  text-decoration: none;
}

.th-feed-body a:hover {
  color: var(--th-link);
  text-decoration: underline;
}

.th-feed-event {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
}

.th-empty {
  margin: 0;
  font-size: var(--th-font-sm);
  color: var(--th-dim);
}

.th-expand {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: var(--th-font-sm);
  color: var(--th-muted);
  background: transparent;
  border: 1px solid var(--th-border);
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
}

.th-expand:hover {
  color: var(--th-link);
  border-color: #64748b;
}

.th-feed-item.is-extra,
.th-lb-row.is-extra,
.th-upcoming-tournament.is-extra,
.th-fact-card.is-extra {
  display: none;
}

.th-feed-block.is-expanded .th-feed-item.is-extra,
.th-upcoming-list.is-expanded .th-upcoming-tournament.is-extra,
.th-facts-grid.is-expanded .th-fact-card.is-extra {
  display: block;
}

.th-lb-list.is-expanded .th-lb-row.is-extra {
  display: grid;
}

/* Fun facts */
.th-facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 480px) {
  .th-facts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .th-facts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.th-fact-card {
  padding: 0.75rem;
  background: var(--th-bg);
  border: 1px solid var(--th-border);
  border-radius: 0.5rem;
}

.th-fact-label {
  margin-bottom: 0.35rem;
  font-size: var(--th-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
}

.th-fact-athlete {
  margin-bottom: 0.25rem;
  font-size: var(--th-font);
  font-weight: 700;
}

.th-fact-athlete a {
  color: var(--th-text);
  text-decoration: none;
}

.th-fact-stat {
  font-size: var(--th-font-sm);
  color: var(--th-text);
}

.th-fact-meta {
  margin-top: 0.15rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
}

/* Upcoming — grouped by date, then tournament */
.th-upcoming-date-group {
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--th-border);
}

.th-upcoming-date-group:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.th-upcoming-date-heading {
  margin: 0 0 0.6rem;
  font-size: var(--th-font-sm);
  font-weight: 700;
  color: var(--th-gold);
  letter-spacing: 0.02em;
}

.th-upcoming-tournament {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--th-border);
  border-radius: 0.5rem;
}

.th-upcoming-tournament:last-child {
  margin-bottom: 0;
}

.th-upcoming-tournament-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.th-upcoming-title {
  display: block;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--th-text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  min-width: 0;
}

.th-upcoming-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--th-dim);
  line-height: 1.3;
}

.th-upcoming-athletes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.th-upcoming-athlete {
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.th-upcoming-athlete:first-child {
  border-top: none;
}

.th-upcoming-athlete-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  color: var(--th-text);
  text-decoration: none;
  font-size: var(--th-font-sm);
}

.th-upcoming-athlete-link:hover {
  color: var(--th-link);
}

.th-upcoming-athlete-name {
  min-width: 0;
  font-weight: 400;
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.th-upcoming-athlete-elo {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--th-gold);
}

/* Leaderboards */
.th-lb-grid {
  display: grid;
  gap: var(--th-space);
}

@media (min-width: 992px) {
  .th-lb-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.th-lb-note {
  margin: 0 0 0.65rem;
  font-size: var(--th-font-xs);
  color: var(--th-dim);
  line-height: 1.4;
}

.th-lb-note[hidden] {
  display: none !important;
}

.th-lb-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--th-border);
  text-decoration: none;
  color: inherit;
}

.th-lb-row.th-lb-row--country {
  grid-template-columns: 2rem auto 1fr auto;
}

a.th-lb-row:hover {
  color: var(--th-link);
}

.th-lb-rank {
  font-weight: 700;
  font-size: var(--th-font-sm);
  text-align: center;
  color: var(--th-dim);
}

.th-lb-rank.top1 { color: var(--th-gold); }
.th-lb-rank.top2 { color: #cbd5e1; }
.th-lb-rank.top3 { color: #d97706; }

.th-lb-flag {
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
}

.th-lb-main {
  min-width: 0;
}

.th-lb-name {
  display: block;
  font-size: var(--th-font-sm);
  font-weight: 600;
  line-height: 1.3;
}

.th-lb-country {
  font-size: var(--th-font-xs);
  font-weight: 500;
  color: var(--th-muted);
  white-space: nowrap;
}

.th-lb-meta {
  display: block;
  margin-top: 0.1rem;
  font-size: var(--th-font-xs);
  color: var(--th-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.th-lb-meta a {
  color: var(--th-link);
  text-decoration: none;
}

.th-lb-score {
  font-size: var(--th-font);
  font-weight: 700;
  color: var(--th-gold);
  font-variant-numeric: tabular-nums;
}

.th-loading {
  margin: 0;
  font-size: var(--th-font-sm);
  color: var(--th-dim);
}

.th-cta-row {
  margin-top: 0.5rem;
}

.test-home-page .jf-affiliate-section {
  margin-top: var(--th-space);
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

.test-home-page .jf-affiliate-inner {
  max-width: 42rem;
  padding: 0;
}

@media (min-width: 1200px) {
  .test-home-page .jf-affiliate-inner {
    max-width: 76rem;
  }
}

.test-home-page .site-footer {
  margin-top: 0;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

.test-home-page .site-footer .container {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.75rem 0 2rem;
}

@media (min-width: 1200px) {
  .test-home-page .site-footer .container {
    max-width: 76rem;
  }
}
