/* Pro Judo — shared layout & small screens */

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

.container {
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

.site-nav-bar {
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.site-nav-actions {
  display: flex;
  flex-shrink: 1;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.site-nav-links {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  gap: 0.5rem 0.65rem;
  justify-content: flex-end;
  align-items: center;
}

.nav-top-link {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-top-link:hover {
  color: #f8fafc;
}

.site-nav-bar .navbar-brand {
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Mobile menu — slide-in drawer (no Bootstrap collapse) */
.site-nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.site-nav-menu-btn:hover,
.site-nav-menu-btn:focus {
  border-color: #64748b;
  background: #334155;
  color: #fff;
  outline: none;
}

.site-nav-menu-icon {
  flex-shrink: 0;
  color: #93c5fd;
}

.site-nav-sheet {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
}

.site-nav-sheet.is-open {
  display: block;
  pointer-events: auto;
}

.site-nav-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.site-nav-sheet.is-open .site-nav-sheet-backdrop {
  opacity: 1;
}

.site-nav-sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(19rem, 100vw);
  max-width: 100%;
  height: 100%;
  background: #0f172a;
  border-left: 1px solid #334155;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-right: env(safe-area-inset-right);
}

.site-nav-sheet.is-open .site-nav-sheet-panel {
  transform: translateX(0);
}

.site-nav-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #334155;
}

.site-nav-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.site-nav-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.site-nav-sheet-close:hover,
.site-nav-sheet-close:focus {
  background: #1e293b;
  color: #f8fafc;
  outline: none;
}

.site-nav-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.site-nav-sheet-links {
  flex: 1;
  padding: 0.35rem 0;
}

.site-nav-drawer-link {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  -webkit-tap-highlight-color: transparent;
}

.site-nav-drawer-link:last-child {
  border-bottom: none;
}

.site-nav-drawer-link:active,
.site-nav-drawer-link:focus {
  background: #1e293b;
  color: #fff;
  outline: none;
}

.site-nav-drawer-link-accent {
  margin-top: 0.35rem;
  border-top: 1px solid #334155;
  border-bottom: none;
  color: #fbbf24;
}

.site-nav-drawer-link-accent:active,
.site-nav-drawer-link-accent:focus {
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.site-nav-sheet-lang {
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #334155;
  background: rgba(15, 23, 42, 0.98);
}

.site-nav-sheet-lang-label {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.site-nav-lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.site-nav-lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.site-nav-lang-chip .lang-flag {
  font-size: 1rem;
}

.site-nav-lang-chip.is-active {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.site-nav-lang-chip:active {
  background: #334155;
}

body.site-nav-sheet-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .site-nav-sheet-backdrop,
  .site-nav-sheet-panel {
    transition: none;
  }
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
  padding-left: 0.75rem;
  border-left: 1px solid #334155;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.2rem;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  line-height: 1;
  box-shadow: none;
  vertical-align: middle;
}

.lang-switch-btn:hover,
.lang-switch-btn:focus,
.lang-switch-btn:active,
.lang-switch-btn.show {
  background: transparent;
  border: none;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45);
  color: inherit;
}

.lang-switch-menu {
  min-width: 9rem;
  padding: 0.35rem 0;
  border: 1px solid #475569;
  background: #1e293b;
}

.lang-switch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.lang-switch-item .lang-flag {
  font-size: 1.15rem;
}

.lang-switch-item.active,
.lang-switch-item:active {
  background: #334155;
  color: #fbbf24;
}

.lang-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.card-panel {
  max-width: 100%;
}

/* Settings — email + save button (avoid clipped input on narrow screens) */
.settings-email-group {
  width: 100%;
  max-width: 100%;
}

.settings-email-group .form-control {
  min-width: 0;
  width: 100%;
}

@media (max-width: 575.98px) {
  .settings-email-group .settings-email-save {
    width: 100%;
  }
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
  .site-nav-bar {
    gap: 0.35rem;
  }

  .site-nav-bar .navbar-brand {
    font-size: 1.05rem;
  }

  .lang-flag {
    font-size: 1.2rem;
  }

  .display-5,
  .hero-title {
    font-size: 1.65rem !important;
  }

  .hero {
    padding: 1.35rem 0 1.75rem;
  }

  .hero-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  .input-group-lg > .form-control {
    font-size: 1rem;
    min-height: 2.75rem;
  }

  .fighter-header-card {
    padding-right: 0 !important;
  }

  .fighter-page .fighter-header-card {
    padding: 0.75rem !important;
  }

  .fighter-page h1.h2.brand {
    font-size: 1.05rem;
  }

  .fighter-page .card-panel.p-3,
  .fighter-page .card-panel.p-4 {
    padding: 0.75rem !important;
  }

  .fighter-page .h5 {
    font-size: 0.88rem;
    margin-bottom: 0.5rem !important;
  }

  .fighter-page .text-muted-custom,
  .fighter-page .text-muted-custom.small,
  .fighter-page p.small {
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .fighter-page .division-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
  }

  .fighter-page .elo-badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
  }

  .fighter-page .medal-pill {
    font-size: 0.65rem;
    padding: 0.08rem 0.38rem;
  }

  .fighter-page .header-stat {
    font-size: 0.65rem;
  }

  .fighter-page .verified-badge {
    width: 1rem;
    height: 1rem;
    font-size: 0.62rem;
  }

  .fighter-page .active-marker {
    width: 7px;
    height: 7px;
  }

  .fighter-page .country-code-link {
    font-size: 0.72rem;
  }

  .fighter-page .instagram-link {
    font-size: 0.72rem;
  }

  .fighter-page .titles-section h2.h5 {
    font-size: 0.88rem;
  }

  .fighter-page .titles-section h3 {
    font-size: 0.68rem;
    margin: 0.55rem 0 0.35rem;
  }

  .fighter-page .title-label {
    font-size: 0.62rem;
    min-height: 1.9em;
  }

  .fighter-page .title-count {
    font-size: 0.68rem;
  }

  .fighter-page .title-meta {
    font-size: 0.58rem;
  }

  .fighter-page .title-thumb {
    height: 48px;
    font-size: 1.35rem;
  }

  .fighter-page .title-body {
    padding: 0.35rem 0.3rem 0.45rem;
  }

  .fighter-page .claim-profile-compact .claim-profile-hint {
    font-size: 0.52rem;
  }

  .fighter-page .claim-profile-compact .btn-claim {
    font-size: 0.55rem;
  }

  .fighter-page .fighter-headshot {
    width: 48px;
    height: 62px;
    border-radius: 0.45rem;
  }

  .fighter-page .fighter-data-table .text-muted-custom {
    font-size: 0.62rem;
  }

  .fighter-page .row.g-4 {
    --bs-gutter-y: 0.75rem;
  }

  .claim-profile-compact {
    width: auto;
    max-width: 9.5rem;
  }

  .country-header-card {
    padding-right: 0 !important;
  }

  .country-flag {
    position: static;
    width: 72px;
    height: 54px;
    display: block;
    margin: 0 0 0.75rem auto;
    object-fit: contain;
  }

  .h2.brand,
  h1.h2,
  h1.h3 {
    font-size: 1.3rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .athlete-name-line {
    flex-wrap: wrap;
  }

  .medal-summary {
    gap: 0.35rem !important;
  }

  .medal-pill,
  .header-stat,
  .stat-pill-inline {
    font-size: 0.78rem;
  }

  .elo-badge {
    font-size: 0.95rem;
  }

  .search-hit.d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  .search-hit .btn {
    width: 100%;
  }

  .letter-nav a {
    min-width: 1.65rem;
    font-size: 0.72rem;
    padding: 0.12rem 0.3rem;
  }

  .title-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
  }

  .elo-chart-wrap {
    height: 160px;
  }

  .elo-chart-y-labels {
    font-size: 0.62rem;
    min-width: 1.85rem;
  }

  a.lb-row:hover {
    transform: none;
  }

  .lb-meta {
    font-size: 0.7rem;
    line-height: 1.35;
  }

  .lb-elo {
    font-size: 0.88rem;
  }

  .lb-row.country-lb-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .lb-row.country-lb-row .lb-elo {
    width: 100%;
    text-align: right;
    margin-top: 0.15rem;
  }

  .leaderboard-actions .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 0.35rem;
  }

  .leaderboard-actions .btn:first-child {
    margin-top: 0;
  }

  .card-panel.p-4 {
    padding: 1rem !important;
  }

  .table {
    font-size: 0.8rem;
  }

  .table td,
  .table th {
    padding: 0.4rem 0.35rem;
  }
}

@media (max-width: 767.98px) {
  .fighter-page .fighter-header-layout {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .fighter-page .fighter-header-main {
    order: 1;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
  }

  .fighter-page .fighter-headshot-wrap {
    order: 2;
    flex: 0 0 auto;
    width: 64px;
  }

  .fighter-page .fighter-headshot {
    width: 64px;
    height: 82px;
    border-radius: 0.5rem;
  }

  .fighter-page .fighter-header-content {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .fighter-page .fighter-header-aside {
    order: 2;
    flex: 0 0 auto;
    position: static;
    width: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin: 0;
  }

  .fighter-page .fighter-flag {
    width: 30px;
    height: auto;
  }

  .fighter-page .fighter-header-meta {
    margin-bottom: 0.35rem;
  }

  .fighter-page .fighter-meta-row {
    display: block;
    margin-bottom: 0.2rem;
    line-height: 1.35;
  }

  .fighter-page .fighter-meta-row:last-child {
    margin-bottom: 0;
  }

  .fighter-page .fighter-meta-last-competed,
  .fighter-page .fighter-meta-also-competed {
    display: none !important;
  }

  .fighter-page .fighter-header-medals {
    margin-top: 0.35rem;
    margin-bottom: 0.2rem;
  }

  .fighter-page .fighter-header-stats {
    width: 100%;
    margin-top: 0;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(51, 65, 85, 0.65);
  }

  .fighter-page .claim-profile-compact {
    width: 48px;
    max-width: 48px;
  }

  .fighter-page .claim-profile-compact .claim-profile-hint {
    display: none;
  }

  .fighter-page .claim-profile-compact .btn-claim {
    padding: 0.22rem 0.15rem;
    font-size: 0.5rem;
  }

  .fighter-page .fighter-table-wrap {
    overflow: visible;
  }

  .fighter-page .fighter-data-table {
    font-size: 0.72rem;
  }

  .fighter-page .fighter-data-table thead {
    display: none;
  }

  .fighter-page .fighter-data-table tbody tr {
    display: block;
    border: 1px solid #334155;
    border-radius: 0.45rem;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.45rem;
    background: rgba(15, 23, 42, 0.5);
  }

  .fighter-page .fighter-data-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .fighter-page .fighter-data-table tbody td {
    display: block;
    border: none;
    padding: 0.12rem 0;
    font-size: 0.7rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .fighter-page .fighter-data-table tbody td:not(:first-child)::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    font-size: 0.58rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .fighter-page .fighter-data-table tbody td:first-child {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    padding-bottom: 0.2rem;
    margin-bottom: 0.05rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  }

  .fighter-page .fighter-data-table .badge {
    font-size: 0.62rem;
    padding: 0.2em 0.45em;
  }

  .fighter-page .fighter-table-block.is-truncated:not(.is-expanded) tbody tr:nth-child(n+6) {
    display: none;
  }

  .fighter-page .fighter-table-expand {
    font-size: 0.7rem;
    padding: 0.32rem 0.5rem;
  }

  /* Notable Facts — match Results card typography on mobile */
  .fighter-page .match-highlights-row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0.4rem;
  }

  .fighter-page .match-highlights-row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
  }

  .fighter-page .match-highlight-card {
    padding: 0.4rem 0.45rem;
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.5);
  }

  .fighter-page .match-highlight-label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.12rem;
    line-height: 1.35;
  }

  .fighter-page .match-highlight-opponent {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.35;
    padding-bottom: 0.2rem;
    margin-bottom: 0.05rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  }

  .fighter-page .match-highlight-opponent .opponent-link {
    font-size: inherit;
    font-weight: inherit;
  }

  .fighter-page .match-highlight-card:not(:has(.match-highlight-opponent))
    > .match-highlight-label + .match-highlight-stat {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    padding-bottom: 0.2rem;
    margin-bottom: 0.05rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  }

  .fighter-page .match-highlight-stat {
    font-size: 0.7rem;
    line-height: 1.35;
    color: #e2e8f0;
    margin-bottom: 0;
    word-break: break-word;
  }

  .fighter-page .match-highlight-meta {
    font-size: 0.62rem;
    line-height: 1.35;
    color: #64748b;
    margin-top: 0.12rem;
  }
}

@media (min-width: 768px) {
  .fighter-page .fighter-header-layout {
    display: block;
  }

  .fighter-page .fighter-header-card {
    position: relative;
    padding-right: 5.5rem !important;
  }

  .fighter-page .fighter-header-aside {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 72px;
  }

  .fighter-page .fighter-headshot-wrap {
    width: 128px;
  }

  .fighter-page .fighter-headshot {
    width: 128px;
    height: 166px;
  }

  .fighter-page .fighter-flag {
    width: 72px;
  }

  .fighter-page .fighter-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.5rem;
  }

  .fighter-page .fighter-meta-row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0;
  }

  .fighter-page .fighter-header-stats {
    border-top: none;
    padding-top: 0;
    margin-top: 0.35rem;
  }

  .fighter-page .fighter-table-block.is-truncated tbody tr {
    display: table-row;
  }

  .fighter-page .fighter-table-expand-wrap,
  .mobile-truncate-expand-wrap {
    display: none !important;
  }
}

/* Mobile: show 5 rows, expand for lists and tables */
.mobile-truncate-expand-wrap {
  display: none;
}

.mobile-truncate-expand {
  border-color: #475569;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.mobile-truncate-expand:hover {
  border-color: #64748b;
  color: #f8fafc;
  background: #334155;
}

@media (max-width: 767.98px) {
  .home-lb-list .country-lb-rated-meta {
    display: none;
  }

  .mobile-truncate-block.is-truncated:not(.is-expanded) > *:nth-child(n+6),
  .fighter-table-block.is-truncated:not(.is-expanded) tbody tr:nth-child(n+6) {
    display: none !important;
  }

  .mobile-truncate-expand-wrap,
  .fighter-table-expand-wrap {
    display: block;
  }

  .mobile-truncate-expand,
  .fighter-page .fighter-table-expand {
    font-size: 0.7rem;
    padding: 0.32rem 0.5rem;
  }
}

/* Site footer */
.site-footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1.75rem 0 2rem;
  border-top: 1px solid #334155;
  color: #64748b;
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.site-footer .footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  line-height: 0;
  text-decoration: none;
}

.site-footer .footer-icon:hover {
  color: #93c5fd;
}

.site-footer .footer-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.site-footer p {
  margin: 0;
}

/* Judo Fanatics affiliate banner */
.jf-affiliate-section {
  margin-top: 2rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid #334155;
}

.jf-affiliate-inner {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.jf-affiliate-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: #1e293b;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.jf-affiliate-link:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.15);
  color: inherit;
}

.jf-affiliate-logo {
  flex: 0 0 auto;
  width: 200px;
  max-width: min(200px, 42vw);
  height: auto;
  aspect-ratio: 800 / 147;
  object-fit: contain;
}

.jf-affiliate-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.jf-affiliate-kicker {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}

.jf-affiliate-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.jf-affiliate-copy small {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.jf-affiliate-cta {
  flex: 0 0 auto;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .jf-affiliate-link {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .jf-affiliate-copy {
    flex: 1 1 100%;
    align-items: center;
  }

  .jf-affiliate-cta {
    flex: 1 1 100%;
    text-align: center;
  }
}
