/* Site header nav (do not use Bootstrap .nav — that class is shared by tournament tabs) */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #192c6b;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 0.5rem;
}

.site-nav-left {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.site-nav-left > a {
  margin-right: 1rem;
}

.site-nav a {
  color: #fff;
  margin-right: 1rem;
  text-decoration: none;
}

.site-nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav-icon-btn:hover,
.site-nav-icon-btn:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.site-nav-home-btn {
  margin-right: 1rem;
}

.site-nav-auth {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  gap: 0.75rem;
}

.site-nav-login-btn,
.site-nav-logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  padding: 0.35rem 0.9rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav-locale-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  padding: 0.35rem 1.5rem 0.35rem 0.55rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  max-width: 12.5rem;
}

.site-nav-locale-select:hover,
.site-nav-locale-select:focus {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.site-nav-locale-select option {
  color: #192c6b;
  background: #fff;
}

/* Unlayered author CSS beats Bootstrap 5.3 layered utilities — hide explicitly */
.site-nav-login-btn.d-none,
.site-nav-logout-btn.d-none,
.site-nav-manage-btn.d-none {
  display: none;
}

.site-nav-login-btn:hover,
.site-nav-logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-nav-profile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

/* Only show when Auth removes .d-none (logged in). Avoid display:inline-flex on the
   base class — it overrides Bootstrap's layered .d-none and keeps the icon visible. */
.site-nav-profile-btn:not(.d-none) {
  display: inline-flex;
  flex-shrink: 0;
}

.site-nav-profile-btn:hover,
.site-nav-profile-btn:focus {
  color: #fff;
  outline: none;
}

@media (max-width: 576px) {
  .site-nav {
    padding: 0.5rem 0.55rem;
    gap: 0.25rem;
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }

  .site-nav-left > a,
  .site-nav a,
  .site-nav-home-btn {
    margin-right: 0.2rem;
  }

  .site-nav-auth {
    gap: 0.3rem;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .site-nav-icon-btn,
  .site-nav-profile-btn:not(.d-none) {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1.15rem;
  }

  .site-nav-profile-btn:not(.d-none) {
    font-size: 1.5rem;
  }

  .site-nav-login-btn,
  .site-nav-logout-btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.8125rem;
  }

  .site-nav-locale-select {
    max-width: 4.5rem;
    padding: 0.25rem 1.15rem 0.25rem 0.35rem;
    font-size: 0.8125rem;
  }
}

.profile-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
}

.profile-head-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.profile-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-avatar,
.profile-avatar-placeholder {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-avatar {
  object-fit: cover;
  display: block;
  background: #e8ecf4;
}

.profile-avatar-placeholder {
  background: #e8ecf4;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
}

@media (max-width: 575.98px) {
  .profile-avatar,
  .profile-avatar-placeholder {
    width: 3.75rem;
    height: 3.75rem;
  }

  .profile-avatar-placeholder {
    font-size: 1.85rem;
  }

  .profile-display-name {
    font-size: 1.25rem;
  }

  .profile-username {
    font-size: 0.9rem;
  }

  .profile-head-divider {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

@media (min-width: 768px) {
  .profile-head {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .profile-head-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .profile-head-actions {
    margin-left: auto;
    flex-shrink: 0;
  }
}

.profile-picture-editor {
  max-width: 28rem;
}

.profile-crop-viewport {
  width: 16rem;
  height: 16rem;
  position: relative;
  overflow: hidden;
  background: #1f2430;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.profile-crop-viewport.is-panning {
  cursor: grabbing;
}

.profile-crop-image {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
}

.profile-crop-circle-hint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.profile-display-name {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.profile-username {
  font-size: 1rem;
}

.profile-head-divider {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.profile-setup-save-btn {
  margin-top: 0.5rem;
}

.profile-role-badge {
  font-size: 0.8rem;
  padding: 0.45em 0.75em;
  letter-spacing: 0.02em;
}

.profile-section {
  margin-bottom: 2.5rem;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.profile-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.profile-match-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.profile-match-card {
  border: none;
  border-left: 0.25rem solid var(--navy-green);
  box-shadow: 0 0.125rem 0.5rem rgba(25, 44, 107, 0.12);
  transition: box-shadow 0.15s ease-in-out;
}

.profile-match-link:hover .profile-match-card,
.profile-match-link:focus-visible .profile-match-card {
  box-shadow: 0 0.25rem 0.75rem rgba(25, 44, 107, 0.2);
}

.profile-match-tournament {
  font-weight: 600;
  color: var(--navy-green);
}

.profile-match-link:hover .profile-match-tournament,
.profile-match-link:focus-visible .profile-match-tournament {
  text-decoration: underline;
}

.profile-match-round,
.profile-match-track,
.profile-match-dates {
  font-size: 0.875rem;
}

.profile-match-dates {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.profile-match-date-start {
  text-align: left;
}

.profile-match-date-end {
  text-align: right;
  margin-left: auto;
}

/* Three columns so the score stays centred no matter how long the names are.
   Collapses to a single centred column once there is no room to sit side by side. */
.profile-match-scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.profile-match-player {
  font-size: 1.1rem;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-elo {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--bs-secondary, #6c757d);
  white-space: nowrap;
  margin-left: 0.35rem;
}

.player-flag-name-text-stack .player-elo,
.profile-match-player > .player-elo {
  display: block;
  margin-left: 0;
  margin-top: 0.1rem;
  text-align: start;
}

/* Flag sits on the name row only, not centered against name + ELO. */
.profile-match-player .player-flag-name {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.35rem;
  row-gap: 0;
}

.profile-match-player .player-flag {
  grid-column: 1;
  grid-row: 1;
  margin-top: calc((1.2em - 0.825em) / 2);
}

.profile-match-player .player-flag-name-text-stack {
  display: contents;
}

.profile-match-player .player-flag-name-text {
  grid-column: 2;
  grid-row: 1;
}

.profile-match-player .player-club-name,
.profile-match-player .player-elo {
  grid-column: 2;
}

#profileMatchPlayerName {
  text-align: right;
}

.profile-match-score {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy-green);
  white-space: nowrap;
}

@media (max-width: 480px) {
  /* Player/opponent flags share column 1 of the same grid. */
  .profile-match-scoreline {
    grid-template-columns: auto max-content;
    justify-content: center;
    align-items: start;
    column-gap: 0.35rem;
    row-gap: 0.1rem;
    text-align: start;
  }

  .profile-match-player,
  .profile-match-player .player-flag-name {
    display: contents;
  }

  .profile-match-player .player-flag,
  .profile-match-player .player-flag-name-text {
    grid-row: auto;
  }

  .profile-match-player .player-flag-name-text,
  .profile-match-player .player-club-name,
  .profile-match-player .player-elo {
    justify-self: start;
    text-align: start;
    max-width: 16rem;
  }

  .profile-match-player,
  .profile-match-player.my-tournament-player-home,
  .profile-match-player.my-tournament-player-away,
  #profileMatchPlayerName {
    text-align: start;
  }

  .profile-match-score {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* Clickable player/team rows that open tournament stats */
.player-stats-row {
    cursor: pointer;
}

.player-stats-row:hover .player-flag-name-text,
.player-stats-row:focus-visible .player-flag-name-text {
    text-decoration: underline;
}

.player-stats-row:focus-visible {
    outline: 2px solid rgba(25, 44, 107, 0.35);
    outline-offset: -2px;
}

.my-tournament-subject-heading {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy-green);
}

.my-tournament-profile-cta {
  font-size: 0.95rem;
  margin-top: 0;
}

.my-tournament-profile-link {
  text-decoration: underline;
}

.my-tournament-team-roster {
  margin-top: 0.25rem;
}

.my-tournament-team-roster .list-unstyled {
  padding-left: 0 !important;
}

/* Profile button in manage-players table */
.player-action-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
}

.player-action-slot {
    flex: 0 0 2.125rem;
    width: 2.125rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.player-action-slot .btn {
    padding: 0.15rem 0.35rem;
    line-height: 1;
}

.my-tournament-section {
  margin-bottom: 1.75rem;
}

.my-tournament-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy-green);
  margin-bottom: 0.75rem;
}

.my-tournament-empty {
  font-size: 0.95rem;
}

.my-tournament-infograph {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(25, 44, 107, 0.12);
  border-bottom: 1px solid rgba(25, 44, 107, 0.12);
}

.my-tournament-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.my-tournament-stat-label {
  font-size: 0.8rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.my-tournament-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-green);
  overflow-wrap: anywhere;
}

.my-tournament-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.my-tournament-match-link .profile-match-card {
  margin-bottom: 0;
}

.my-tournament-player-home {
  text-align: right;
}

.my-tournament-player-away {
  text-align: left;
}

@media (max-width: 480px) {
  .my-tournament-player-home,
  .my-tournament-player-away {
    text-align: start;
  }
}

@media (max-width: 576px) {
  .my-tournament-infograph {
    grid-template-columns: 1fr;
  }
}

.profile-tournaments-table {
  table-layout: fixed;
  width: 100%;
}

.profile-tournaments-col-position {
  width: 3.25rem;
}

.profile-tournaments-col-name {
  width: 42%;
}

.profile-tournaments-col-elo {
  width: 4.25rem;
}

.profile-tournaments-col-location {
  width: 0;
}

.profile-tournaments-col-status {
  width: 38%;
}

@media (min-width: 768px) {
  .profile-tournaments-col-position {
    width: 3.5rem;
  }

  .profile-tournaments-col-name {
    width: 32%;
  }

  .profile-tournaments-col-elo {
    width: 4.75rem;
  }

  .profile-tournaments-col-location {
    width: 24%;
  }

  .profile-tournaments-col-status {
    width: 24%;
  }
}

.profile-tournaments-table th.profile-tournaments-position,
.profile-tournaments-table td.profile-tournaments-position {
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.profile-tournaments-table td.profile-tournaments-position .se-place-badge {
  margin-left: 0;
}

.profile-tournaments-table th,
.profile-tournaments-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-tournaments-name-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

.profile-tournaments-name-primary {
  min-width: 0;
  max-width: 100%;
}

.profile-tournaments-name-meta {
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #6c757d;
}

.profile-tournaments-time {
  display: block;
  font-size: 0.75rem;
  color: #6c757d;
}

.profile-tournaments-table th.profile-tournaments-elo,
.profile-tournaments-table td.profile-tournaments-elo {
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.profile-elo-positive {
  color: #198754;
}

.profile-elo-negative {
  color: #dc3545;
}

.profile-elo-none {
  color: #212529;
}

.profile-tournaments-table th.profile-tournaments-status {
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

.profile-tournaments-status .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.15;
  vertical-align: middle;
}

@media (max-width: 575.98px) {
  .profile-tournaments-name-meta {
    font-size: 0.75rem;
  }

  .profile-tournaments-time {
    font-size: 0.6875rem;
  }

  .profile-tournaments-status .badge {
    font-size: 0.7em;
    padding: 0.3em 0.45em;
  }
}

/* Keep the location column in the table layout on small screens. Bootstrap
   display:none on those cells made the 0% location <col> apply to Status
   instead, so "Staatus" wrapped one letter per line. */
@media (max-width: 767.98px) {
  .profile-tournaments-location {
    visibility: hidden;
    overflow: hidden;
    width: 0;
    max-width: 0;
    padding: 0 !important;
    border: 0;
    font-size: 0;
    line-height: 0;
  }
}

.profile-tournaments-table tbody tr {
  cursor: pointer;
}

.profile-tournaments-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.profile-tournaments-controls.d-none {
  display: none !important;
}

.profile-tournaments-search {
  flex: 1 1 12rem;
  max-width: 18rem;
  min-width: 10rem;
}

.profile-tournaments-controls .pagination {
  margin-bottom: 0;
}

:root {
  --navy-green: #192c6b;
  /* tweak if you prefer a different navy green */
  --login-modal-bg: #2a4080;
  --login-modal-input-bg: #4a63a8;
  --login-modal-text: #f5f7fb;
}

/* Login / signup modal */
.login-modal-content {
  background-color: var(--login-modal-bg);
  color: var(--login-modal-text);
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
}

.login-modal-header {
  color: var(--login-modal-text);
}

.login-modal-header .modal-title {
  color: var(--login-modal-text);
  font-weight: 600;
}

.login-modal-body {
  padding-top: 0.25rem;
}

.login-modal-input {
  background-color: var(--login-modal-input-bg);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--login-modal-text);
}

.login-modal-input::placeholder {
  color: rgba(245, 247, 251, 0.7);
}

.login-modal-input:focus {
  background-color: #5570b5;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.15);
}

.login-modal-input.is-invalid {
  border-color: #ffb4b4;
}

.login-modal-content .invalid-feedback {
  color: #ffc9c9;
}

.login-modal-submit {
  background-color: #ffffff;
  border-color: #ffffff;
  color: var(--navy-green);
  font-weight: 600;
}

.login-modal-submit:hover,
.login-modal-submit:focus {
  background-color: #f0f2f8;
  border-color: #f0f2f8;
  color: var(--navy-green);
}

.login-modal-submit:disabled {
  background-color: #e8ebf4;
  border-color: #e8ebf4;
  color: #6b7aa5;
}

.login-modal-link {
  color: #ffffff !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-modal-link:hover {
  color: #e8ecf8 !important;
}

.login-modal-divider {
  color: rgba(245, 247, 251, 0.85);
}

.login-modal-divider hr {
  border-color: rgba(255, 255, 255, 0.35);
  opacity: 1;
}

.login-modal-google-wrap {
  position: relative;
  width: 100%;
  min-height: 44px;
}

.login-modal-google-fallback {
  background-color: var(--login-modal-input-bg);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--login-modal-text);
  font-weight: 600;
  pointer-events: none;
}

.login-modal-google-fallback:hover,
.login-modal-google-fallback:focus {
  background-color: #5570b5;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.login-modal-google {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  overflow: hidden;
  cursor: pointer;
}

.login-modal-google > div,
.login-modal-google iframe {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.login-modal-content .alert-danger {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: rgba(255, 180, 180, 0.45);
  color: #ffe0e0;
}

.login-modal-content .alert-warning {
  background-color: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 220, 150, 0.45);
  color: #fff3cd;
}

/* #content shows stripes; .container panels sit on solid white */
html,
body {
  height: 100%;
}

body {
  background-color: #ffffff;
}

#content {
  flex-grow: 1;
  padding: 1rem 0.75rem;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(45deg,
      rgba(25, 44, 107, 0.14) 0 12px,
      transparent 12px 24px);
}

#content .container {
  background-color: #ffffff;
  border-radius: 0.25rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-spacing-from-content {
  margin-bottom: 1.5rem;
}

.pointer-cursor {
  cursor: pointer;
}

.bg-navy-green {
  background-color: #192c6b !important;
}

.table.table-striped.tournaments-listing-head thead th,
.table.table-hover.tournaments-listing-head thead th {
  background-color: #1f2937 !important;
  color: #fff !important;
}

/* Custom hover color for this table only */
.table.table-hover.tournaments-listing-head {
  --bs-table-hover-bg: #eef2ff;
  /* light indigo */
  --bs-table-hover-color: #111827;
  /* near-black text */
}

/* Optional smooth hover */
.table.table-hover.tournaments-listing-head tbody tr {
  transition: background-color 120ms ease, color 120ms ease;
}

.custom-home-button {
  background-color: #eef2ff;
  margin-right: 0.5rem;
}

.custom-home-button-active {
  background-color: #c7d2fe;
  border-color: #a5b4fc;
  color: #1e3a8a;
}

/* Tournament info trigger — distinct from action buttons */
.tournament-info-trigger {
  background-color: #1e293b;
  border-color: #1e293b;
  color: #fff;
  font-weight: 600;
  margin-right: 0;
}

.tournament-info-trigger:hover,
.tournament-info-trigger:focus {
  background-color: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

/* Keep info + action buttons on one baseline in the engine header row */
.tournament-info-header-row {
  align-items: center;
}

.tournament-info-header-row .tournament-info-actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tournament-info-header-row .tournament-info-actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 8.5rem);
  max-width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  white-space: normal;
  text-align: center;
}

/* Desktop: hug content instead of filling the half-width column */
@media (min-width: 992px) {
  .tournament-info-header-row .tournament-info-actions {
    width: auto;
  }

  .tournament-info-header-row .tournament-info-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }
}

.tournament-info-header-row .tournament-info-actions .custom-home-button {
  margin-right: 0;
}

/* Overview header — mobile: status + settings on row 1, registration + manage team on row 2 */
.tournament-overview-header__status-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.tournament-overview-header__status-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.tournament-overview-header__settings-mobile,
.tournament-overview-header__print-mobile {
  flex: 0 0 auto;
}

.tournament-overview-header__registration-primary {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.tournament-overview-header__registration-primary > .btn,
.tournament-overview-header__registration-primary > span.btn {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0 !important;
}

.tournament-overview-header__registration-secondary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

@media (max-width: 991.98px) {
  .tournament-info-header-row .tournament-info-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tournament-info-header-row .tournament-info-actions .btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 767.98px) {
  .tournament-info-header-row .tournament-overview-header__actions {
    margin-top: 0.5rem;
  }

  #tournament-registration-actions {
    align-items: stretch !important;
  }

  .tournament-overview-header__registration-primary .js-manage-team-btn {
    order: 2;
  }

  .tournament-overview-header__registration-primary > .btn:not(.js-manage-team-btn),
  .tournament-overview-header__registration-primary > span.btn {
    order: 1;
  }
}

@media (min-width: 768px) {
  .tournament-overview-header__status-row {
    width: max-content;
    max-width: 100%;
  }

  .tournament-overview-header__status-btn {
    flex: 0 0 auto;
  }

  .tournament-info-header-row .tournament-overview-header__actions .tournament-info-actions {
    width: auto;
    flex-direction: row;
    align-items: stretch;
  }

  .tournament-info-header-row .tournament-overview-header__actions .tournament-info-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }

  .tournament-overview-header__registration-primary,
  .tournament-overview-header__registration-secondary {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    width: auto;
  }

  .tournament-overview-header__registration-primary > .btn,
  .tournament-overview-header__registration-primary > span.btn {
    flex: 0 0 auto;
    width: auto;
  }
}

.swiss-round-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.swiss-round-timer .bi-stopwatch {
  font-size: 1rem;
  letter-spacing: 0;
  opacity: 0.75;
}

.swiss-round-timer__value {
  min-width: 7.5ch;
  text-align: center;
}

.swiss-round-timer.swiss-round-timer--overtime,
.swiss-round-timer.text-danger {
  background: linear-gradient(180deg, #fef2f2 0%, #fecaca 100%);
  border-color: #f87171;
  color: #991b1b;
}

.swiss-round-timer-wrap--below {
  margin-top: 0.5rem;
}

.swiss-round-timer-wrap--center {
  min-width: 0;
}

.swiss-timer-row {
  align-items: center;
}

.swiss-organizer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.swiss-organizer-header__info {
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
}

.swiss-organizer-header__actions {
  display: contents;
}

.swiss-organizer-header__view {
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
  display: flex;
}

.swiss-organizer-header__round {
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
}

.swiss-organizer-header__timer {
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  margin-top: 0;
}

.swiss-organizer-header__info .tournament-info-trigger {
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin-right: 0;
  justify-content: flex-start;
  box-sizing: border-box;
}

.swiss-organizer-header__view .btn,
.swiss-organizer-header__round .btn,
.swiss-organizer-header__timer .swiss-round-timer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-right: 0;
  justify-content: center;
  min-height: 2.75rem;
  box-sizing: border-box;
  flex-wrap: wrap;
  white-space: normal;
  text-align: center;
}

.swiss-organizer-header__timer .swiss-round-timer,
.swiss-organizer-header__view .btn {
  flex: 1 1 auto;
}

.swiss-organizer-header__round .btn {
  flex: 0 0 auto;
  width: 100%;
}

.swiss-organizer-header--spectator-timer .swiss-organizer-header__timer {
  grid-column: 1;
}

.swiss-organizer-header--spectator-timer .swiss-organizer-header__view {
  grid-column: 1;
}

/* Tablet: stack status + view like SE; timer/round can sit side by side below */
@media (min-width: 576px) and (max-width: 991.98px) {
  .swiss-organizer-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.5rem 0.75rem;
  }

  .swiss-organizer-header__info {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .swiss-organizer-header__view {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .swiss-organizer-header__timer {
    grid-column: 1;
    grid-row: 3;
  }

  .swiss-organizer-header__round {
    grid-column: 2;
    grid-row: 3;
  }

  .swiss-organizer-header--spectator-timer .swiss-organizer-header__timer {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .swiss-organizer-header--spectator-timer .swiss-organizer-header__view {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .swiss-organizer-header:has(.swiss-organizer-header__round .btn:nth-child(2)) .swiss-organizer-header__timer {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .swiss-organizer-header:has(.swiss-organizer-header__round .btn:nth-child(2)) .swiss-organizer-header__round {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

@media (min-width: 992px) {
  .swiss-timer-row {
    align-items: flex-start;
  }

  .swiss-timer-row .swiss-round-timer-wrap--center {
    padding-top: 0.15rem;
  }

  .swiss-organizer-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
    align-items: start;
  }

  .swiss-organizer-header__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    align-items: stretch;
  }

  .swiss-organizer-header__view,
  .swiss-organizer-header__round {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .swiss-organizer-header__timer {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .swiss-organizer-header__info .tournament-info-trigger,
  .swiss-organizer-header__view .btn,
  .swiss-organizer-header__round .btn,
  .swiss-organizer-header__timer .swiss-round-timer {
    min-height: 0;
    height: auto;
    flex: 0 0 auto;
  }

  .swiss-organizer-header__info .tournament-info-trigger {
    width: auto;
    justify-content: flex-start;
  }

  .swiss-organizer-header__timer .swiss-round-timer {
    width: 100%;
  }

  .swiss-organizer-header--spectator-timer .swiss-organizer-header__actions {
    grid-row: 1;
  }
}

.team-search-listings-card {
  margin-bottom: 1rem;
}

.team-search-player-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.team-search-player-link:hover,
.team-search-player-link:focus-visible {
  color: var(--bs-primary);
}

.team-search-mobile-meta {
  display: none;
}

@media (max-width: 767.98px) {
  .team-search-listings-table .team-search-col-transport,
  .team-search-listings-table .team-search-col-email,
  .team-search-listings-table .team-search-col-action {
    display: none;
  }

  .team-search-mobile-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
  }
}

.team-invites-section {
  margin-bottom: 1.5rem;
}

.team-invite-card .team-invite-tournament-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.team-invite-card .team-invite-tournament-link:hover,
.organizer-request-card .organizer-request-club-link:hover {
  color: var(--bs-primary);
}

.organizer-request-card .organizer-request-club-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.team-registration-pending-names {
  max-width: 18rem;
  text-align: end;
}

/* The "registered" badge doubles as the unregister control, so hovering must signal
   that clicking removes the entry instead of confirming it. */
#unregister-tournament-button:hover,
#unregister-tournament-button:focus-visible {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
}

.team-member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.75rem;
}

.team-member-chip {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  padding: 0.45em 0.7em;
}

.team-member-chip .btn-close {
  width: 0.55em;
  height: 0.55em;
  padding: 0;
  opacity: 0.65;
}

.team-user-search-results {
  position: absolute;
  z-index: 1056;
  left: 0;
  right: 0;
  top: calc(100% + 0.15rem);
  max-height: 14rem;
  overflow-y: auto;
  box-shadow: 0 0.35rem 0.75rem rgba(0, 0, 0, 0.12);
}

.custom-nav-link {
  color: #ffffff;
  margin-left: 0.5rem;
}

.custom-nav-link:hover {
  color: #d1d5db;
  border-color: #a4aaff !important;
  margin-left: 0.5rem;
}

@font-face {
  font-family: "High Jakarta";
  src: url("/fonts/HighJakarta.woff2") format("woff2"),
       url("/fonts/HighJakarta.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.tournament-page-title {
  font-family: "High Jakarta", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* Tournament page tabs — navy bar like site header, isolated from .site-nav */
.tournament-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  padding: 0.5rem 0.5rem 0;
  background: var(--navy-green, #192c6b);
  border-bottom: none;
}

.tournament-tabs .nav-item {
  margin-bottom: 0;
}

.tournament-tabs .custom-nav-link {
  color: #ffffff;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.tournament-tabs .custom-nav-link:hover,
.tournament-tabs .custom-nav-link:focus {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.tournament-tabs .custom-nav-link.active {
  color: #111827;
  background-color: #ffffff;
  border-color: #ffffff;
}

.custom-tab-background {
  background-color: #f9fafb;
  margin-bottom: 1rem;
}

.field-disabled {
  background-color: #d8dbe0;
}

.engine-item--editable {
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.engine-item--editable:hover {
  box-shadow: 0 6px 20px rgba(89, 127, 183, 0.4);
  transform: translateY(-2px);
}

.se-places-picker {
  min-height: 31px;
  height: 74px;
  padding: 0.35rem 0.45rem;
  overflow-y: auto;
}

.se-places-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
}

.se-place-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  user-select: none;
}

.se-place-option .form-check-input {
  margin-top: 0;
}

.se-place-option--locked {
  opacity: 0.95;
}

.se-place-label {
  font-weight: 600;
}

.btn-save-and-end-match {
  background-color: #192c6b;
  border-color: #192c6b;
  color: #fff;
}

.btn-save-and-end-match:hover,
.btn-save-and-end-match:focus {
  background-color: #142356;
  border-color: #142356;
  color: #fff;
}

.player-team-toggle .player-team-chevron {
  display: inline-block;
  transition: transform 0.15s ease-in-out;
}

.player-flag-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.player-flag-name-text-stack {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.player-flag {
  flex-shrink: 0;
  width: 1.1em;
  height: 0.825em;
  line-height: 0.825em;
  overflow: hidden;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.player-flag-name-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-club-name {
  font-size: 0.75em;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  min-width: 0;
  overflow-wrap: anywhere;
}

a.player-club-name:hover,
a.player-club-name:focus-visible {
  text-decoration: underline;
}

.profile-club-affiliation {
  margin-top: 0;
}

.profile-club-affiliation a {
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
}

.profile-club-affiliation a:hover,
.profile-club-affiliation a:focus-visible {
  text-decoration: underline;
}

.player-team-toggle[aria-expanded="true"] .player-team-chevron {
  transform: rotate(-180deg);
}

.player-team-detail > td {
  background-color: rgba(0, 0, 0, 0.02);
}

.dashboard-kpi-highlight {
  border-color: rgba(25, 135, 84, 0.45);
}

.admin-manage-card {
  transition: box-shadow 0.15s ease-in-out;
}

.admin-manage-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

/* Error toaster stack — fixed overlay below nav (never covers it), does not shift layout */
.error-toaster-stack {
  position: fixed;
  top: 4.5rem; /* fallback until JS measures .site-nav */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 720px;
  pointer-events: none;
}

@media (min-width: 992px) {
  .error-toaster-stack {
    max-width: 960px;
  }
}

.error-toaster {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(184, 92, 87, 0.92);
  color: #fff;
  border-radius: 0.65rem;
  box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.18);
}

.error-toaster-mark {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.error-toaster-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}

.error-toaster-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.15rem 0.4rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}

.error-toaster-close:hover,
.error-toaster-close:focus {
  opacity: 1;
  outline: none;
}

.admin-users-table {
  table-layout: fixed;
  width: 100%;
}

.admin-users-col-id {
  width: 18%;
}

.admin-users-col-username {
  width: 16%;
}

.admin-users-col-email {
  width: 28%;
}

.admin-users-col-status {
  width: 16%;
}

.admin-users-col-role {
  width: 14%;
}

.admin-users-col-settings {
  width: 8%;
}

.admin-users-table th,
.admin-users-table td {
  vertical-align: middle;
}

.admin-users-table td.admin-users-col-id,
.admin-users-table td.admin-users-col-username,
.admin-users-table td.admin-users-col-email {
  overflow: hidden;
}

.admin-users-table td.admin-users-col-id code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-users-table td.admin-users-col-username,
.admin-users-table td.admin-users-col-email {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-users-table td.admin-users-col-status .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.15;
}

.admin-users-role-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1.25;
}

.admin-users-table th.admin-users-col-settings,
.admin-users-table td.admin-users-col-settings {
  white-space: nowrap;
}

.admin-users-empty-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  .admin-users-table-wrap {
    overflow-x: hidden;
  }

  .admin-users-col-id,
  .admin-users-col-email,
  .admin-users-col-status {
    display: none;
  }

  .admin-users-col-username {
    width: 48%;
  }

  .admin-users-col-role {
    width: 32%;
  }

  .admin-users-col-settings {
    width: 20%;
  }

  .admin-users-empty-desktop {
    display: none;
  }

  .admin-users-empty-mobile {
    display: table-cell;
  }

  .admin-users-table .user-settings-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
}

/* Scrollable rating modal: allow the body to shrink so extra scales scroll. */
#ratingCreationModal .modal-body {
  min-height: 0;
}

#ratingCreationModal .js-from-position[readonly] {
  background-color: #d7dce3;
  border-color: #c5cbd4;
  color: #6c757d;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 1;
  -moz-appearance: textfield;
  appearance: textfield;
}

#ratingCreationModal .js-from-position[readonly]::-webkit-inner-spin-button,
#ratingCreationModal .js-from-position[readonly]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#ratingCreationModal .js-add-band-wrap.is-disabled {
  cursor: not-allowed;
}

#ratingCreationModal .rating-connected-list {
  margin-bottom: 0;
}

#ratingCreationModal .rating-connected-list li {
  padding: 0.2rem 0;
}

#ratingCreationModal .rating-connected-phase {
  color: #6c757d;
}

#ratingCreationModal .js-rating-recalc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.15rem 0.4rem 0.1rem;
}

#ratingCreationModal .js-rating-recalc-row .form-check-input {
  position: static;
  float: none;
  margin: 0;
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  background-color: #fff;
  border: 2px solid #192c6b;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0.2rem;
  cursor: pointer;
}

#ratingCreationModal .js-rating-recalc-row .form-check-input:checked {
  background-color: #192c6b;
  border-color: #192c6b;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3 6-6'/%3e%3c/svg%3e");
}

#ratingCreationModal .js-rating-recalc-row .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(25, 44, 107, 0.25);
  border-color: #192c6b;
}

#ratingCreationModal .rating-tournament-link {
  word-break: break-word;
}

.se-place-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.se-place-gold {
  background: #e4b429;
  color: #1a1508;
}

.se-place-silver {
  background: #c5c9d1;
  color: #1a1a1a;
}

.se-place-bronze {
  background: #c67b39;
  color: #fff;
}

.se-place-other {
  background: #2f6fed;
  color: #fff;
}

.rating-standings-modal-content {
  background-color: #192c6b;
  color: #f5f7fb;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
}

.rating-standings-modal-header {
  color: #f5f7fb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.rating-standings-modal-header .modal-title {
  color: #fff;
  font-weight: 700;
}

.rating-standings-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rating-standings-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.rating-standings-modal-action {
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  background: transparent;
  font-weight: 600;
}

.rating-standings-modal-action:hover,
.rating-standings-modal-action:focus {
  background: #fff;
  border-color: #fff;
  color: #192c6b;
}

.rating-standings-modal-empty {
  color: rgba(245, 247, 251, 0.8);
  text-align: center;
  padding: 1.25rem 0.5rem;
}

#ratingStandingsModal .modal-body {
  color: #f5f7fb;
}

#ratingStandingsModal #ratingStandingsEditorTitle {
  color: #fff;
  font-weight: 700;
}

#ratingStandingsModal .alert-danger {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: rgba(255, 180, 180, 0.45);
  color: #ffe0e0;
}

#ratingStandingsModal #ratingStandingsEditorSaveBtn {
  background-color: #fff;
  border-color: #fff;
  color: #192c6b;
  font-weight: 600;
}

#ratingStandingsModal #ratingStandingsEditorSaveBtn:hover,
#ratingStandingsModal #ratingStandingsEditorSaveBtn:focus {
  background-color: #f0f2f8;
  border-color: #f0f2f8;
  color: #192c6b;
}

#ratingStandingsModal #ratingStandingsEditorCancelBtn {
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  background: transparent;
  font-weight: 600;
}

#ratingStandingsModal #ratingStandingsEditorCancelBtn:hover,
#ratingStandingsModal #ratingStandingsEditorCancelBtn:focus {
  background: #fff;
  border-color: #fff;
  color: #192c6b;
}

.rating-standings-table-wrap {
  background: #142356;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(13, 26, 69, 0.35);
}

.rating-standings-table {
  --bs-table-bg: #192c6b;
  --bs-table-color: #fff;
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-hover-bg: #334d96;
  --bs-table-hover-color: #fff;
  --bs-table-striped-bg: #243a82;
  --bs-table-striped-color: #fff;
  color: #fff;
  margin-bottom: 0;
}

.rating-standings-table > thead {
  --bs-table-bg: #0d1a45;
  --bs-table-color: #fff;
  --bs-table-border-color: transparent;
}

.rating-standings-table > thead th {
  color: #fff;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.95rem 0.7rem;
  border-bottom: 3px solid #4a63a8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rating-standings-table > tbody > .rating-standings-row > * {
  color: #fff;
  text-align: center;
  vertical-align: middle;
  border-color: rgba(255, 255, 255, 0.08);
  padding: 0.8rem 0.7rem;
}

.rating-standings-table > tbody > .rating-standings-row > th {
  color: #fff;
}

.rating-standings-row--a > * {
  --bs-table-bg: #192c6b;
  --bs-table-accent-bg: #192c6b;
}

.rating-standings-row--b > * {
  --bs-table-bg: #243a82;
  --bs-table-accent-bg: #243a82;
}

.rating-standings-table > tbody > .rating-standings-row:hover > * {
  --bs-table-accent-bg: #334d96;
  color: #fff;
}

.rating-standings-table > tbody > .rating-standings-row.is-open > * {
  --bs-table-bg: #2f4a9a;
  --bs-table-accent-bg: #2f4a9a;
}

.rating-standings-row:focus {
  outline: none;
}

.rating-standings-row:focus-visible > * {
  box-shadow: inset 0 0 0 2px #e4b429;
}

.rating-standings-rank-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.rating-standings-chevron {
  font-size: 0.75rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.rating-standings-row.is-open .rating-standings-chevron {
  transform: rotate(-180deg);
}

.rating-standings-table .se-place-badge,
.rating-standings-events-table .se-place-badge {
  margin-left: 0;
  min-width: 1.55rem;
  height: 1.55rem;
  font-size: 0.78rem;
}

.rating-standings-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rating-standings-name {
  font-weight: 600;
}

.rating-standings-table .player-flag-name {
  justify-content: center;
}

.rating-standings-table .player-flag,
.rating-standings-events-table .player-flag,
#ratingStandingsEditorTitle .player-flag {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.rating-standings-event-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  max-width: 100%;
}

.rating-standings-events-row > * {
  --bs-table-bg: #142356;
  --bs-table-accent-bg: #142356;
  color: #fff;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rating-standings-accordion {
  padding: 0.85rem 1rem 1.05rem;
}

.rating-standings-accordion-title {
  color: #fff;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.rating-standings-accordion-empty {
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-size: 0.9rem;
}

.rating-standings-events-table {
  --bs-table-bg: #1e3478;
  --bs-table-color: #fff;
  --bs-table-border-color: rgba(255, 255, 255, 0.1);
  --bs-table-striped-bg: #2a4080;
  --bs-table-striped-color: #fff;
  color: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.rating-standings-events-table > thead {
  --bs-table-bg: #15275c;
  --bs-table-color: #fff;
}

.rating-standings-events-table > thead th {
  color: #fff;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.65rem 0.55rem;
  border-bottom: 2px solid #4a63a8;
}

.rating-standings-events-table > tbody > tr:nth-child(odd) > * {
  --bs-table-bg: #1e3478;
  --bs-table-accent-bg: #1e3478;
}

.rating-standings-events-table > tbody > tr:nth-child(even) > * {
  --bs-table-bg: #2a4080;
  --bs-table-accent-bg: #2a4080;
}

.rating-standings-events-table > tbody td {
  color: #fff;
  text-align: center;
  vertical-align: middle;
  padding: 0.6rem 0.55rem;
}

.rating-standings-event-link {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rating-standings-event-link:hover,
.rating-standings-event-link:focus {
  color: #eef2ff;
}

.rating-standings-hidden {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.rating-standings-modify-btn {
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  background: transparent;
  font-weight: 600;
}

.rating-standings-modify-btn:hover,
.rating-standings-modify-btn:focus {
  background: #fff;
  border-color: #fff;
  color: #192c6b;
}

.rating-standings-points-input {
  max-width: 7rem;
  margin: 0 auto;
  text-align: center;
  font-weight: 700;
  color: #192c6b;
}

#ratingStandingsModal tr.js-rating-event-dropped td {
  text-decoration: line-through;
  opacity: 0.7;
}

#ratingStandingsModal tr.js-rating-event-dropped td .badge,
#ratingStandingsModal tr.js-rating-event-dropped td .se-place-badge {
  text-decoration: none;
}

/* Organizer hub */
.container.py-3 > h1.mb-3:has(+ .organizer-hub-subtitle) {
  margin-bottom: 0.35rem;
}

.organizer-hub-subtitle {
  margin-bottom: 1rem;
}

.organizer-hub-subtitle .fi {
  margin-right: 0.35rem;
}

.organizer-hub-composer textarea {
  resize: vertical;
  min-height: 5rem;
}

.organizer-hub-post {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.organizer-hub-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.organizer-hub-post__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.organizer-hub-post__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.organizer-hub-post__edited {
  font-style: italic;
}

.organizer-hub-tournaments-table a {
  font-weight: 600;
}

.organizer-hub-tournament-dates {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #6c757d;
}

.organizer-hub-tournament-dates .js-local-datetime {
  display: block;
}

@media (max-width: 767.98px) {
  .organizer-hub-tournaments-table .organizer-hub-tournament-winner {
    width: 1%;
    text-align: end;
    vertical-align: middle;
    white-space: nowrap;
  }

  .organizer-hub-tournaments-table .organizer-hub-tournament-winner .badge {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

.organizer-hub-rating-row {
  cursor: pointer;
}

.organizer-hub-name-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.organizer-hub-name-link:hover,
.organizer-hub-name-link:focus-visible {
  color: inherit;
}

.not-found-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 14rem);
}

.not-found-page .not-found-panel {
  max-width: 38rem;
  text-align: center;
  padding: 2.5rem 1.75rem;
}

.not-found-code {
  margin: 0 0 0.35rem;
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--navy-green, #192c6b);
}

.not-found-title {
  margin-bottom: 0.85rem;
  color: var(--navy-green, #192c6b);
  font-weight: 600;
}

.not-found-joke {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  color: #1f2937;
}

.not-found-home-btn {
  margin-right: 0;
  min-width: 12rem;
}
