/* 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-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  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;
}

.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%;
}

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

@media (max-width: 575.98px) {
  .navbar .container {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start !important;
  }

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

  .site-nav-links {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 0.15rem;
  }

  .nav-top-link {
    font-size: 0.8125rem;
  }

  .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-header-aside {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .fighter-flag {
    width: 56px;
  }

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

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

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

  .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;
  }

  .settings-email-group {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-email-group .btn {
    width: 100%;
    border-radius: 0.375rem !important;
  }

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

  .table {
    font-size: 0.8rem;
  }

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

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

.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;
  height: 48px;
  width: auto;
  max-width: 140px;
  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;
  }
}
