/* Classes that replaced inline style="" attributes (CSP style-src has no 'unsafe-inline').
   !important keeps the precedence an inline style had over Bootstrap component rules; display,
   visibility and the drop-zone border stay plain because scripts set those inline. */

/* Hidden until a script (or a template condition) shows it. Doubled class beats .btn/.list-group. */
.race-hidden.race-hidden { display: none; }
.d-flex.race-force-hidden { display: none !important; }
.race-invisible { visibility: hidden; }

.race-col-min { width: 1% !important; }
.race-dashed { border-style: dashed !important; }
.race-pointer { cursor: pointer !important; }
.race-nowrap { white-space: nowrap !important; }
.race-uppercase { text-transform: uppercase !important; }
.race-overflow-visible { overflow: visible !important; }
.race-radius-4 { border-radius: 4px !important; }

.race-drag-handle { cursor: grab !important; font-size: 1.1rem !important; line-height: 1 !important; }

.race-select-underline {
  border: none !important;
  border-bottom: 1px solid var(--color-text-placeholder) !important;
  outline: none !important;
  background: transparent !important;
  font-size: 0.85rem !important;
  padding: 0 2px 1px !important;
  width: auto !important;
}
.race-avatar-circle {
  width: 36px !important; height: 36px !important; border-radius: 50% !important;
  background: var(--color-border-strong) !important;
}
.race-avatar-photo {
  width: 36px !important; height: 36px !important; object-fit: cover !important;
  border-radius: 50% !important; flex-shrink: 0 !important;
}

.race-fs-1 { font-size: 1rem !important; }
.race-fs-3 { font-size: 3rem !important; }
.race-fs-065 { font-size: 0.65rem !important; }
.race-fs-072 { font-size: 0.72rem !important; }
.race-fs-075 { font-size: 0.75rem !important; }
.race-fs-078 { font-size: 0.78rem !important; }
.race-fs-085 { font-size: 0.85rem !important; }
.race-badge-small { font-size: 0.7rem !important; vertical-align: middle !important; }
.race-check-big { font-size: 1.75rem !important; line-height: 1 !important; }
.race-place-big { font-size: 1.4rem !important; padding-top: 0.26rem !important; }
.race-place-cell { min-width: 1.8rem !important; font-size: 0.85rem !important; }
.race-chevron { font-size: 0.75rem !important; transition: transform .2s !important; }

.race-w-72 { width: 72px !important; }
.race-w-80 { width: 80px !important; }
.race-w-110 { width: 110px !important; }
.race-w-120 { width: 120px !important; }
.race-max-160 { max-width: 160px !important; }
.race-max-200 { max-width: 200px !important; }
.race-max-220 { max-width: 220px !important; }
.race-max-320 { max-width: 320px !important; }
.race-max-360 { max-width: 360px !important; }
.race-w-144 { width: 144px !important; }

.race-logo-img {
  width: 120px !important; height: 120px !important; object-fit: cover !important;
  border-radius: 8px !important; flex-shrink: 0 !important;
}
.race-logo-preview {
  width: 120px !important; height: 120px !important; object-fit: cover !important;
  border-radius: 8px !important; display: block !important; margin: 0 auto 8px !important;
}
.race-editor { background: var(--color-white) !important; }
.race-editor--description { min-height: 300px !important; }
.race-editor--program { min-height: 200px !important; }

/* No !important on the border: the script recolours it while a file is dragged over. */
.race-dropzone {
  border: 2px dashed var(--color-border-input);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: var(--color-surface-subtle);
  transition: border-color .2s;
}

.race-tier-row { height: 26px !important; }
.race-tier-bar { background: var(--color-surface-muted) !important; }
.race-tier-bar--current { border: 1px dashed var(--color-success) !important; }
.race-tier-label { font-size: 0.75rem !important; z-index: 1 !important; white-space: nowrap !important; }
.race-tier-label--shadow {
  text-shadow: 0 0 4px rgba(255,255,255,0.9), 0 0 8px rgba(255,255,255,0.7) !important;
}
.race-tier-label--muted { color: var(--color-text-muted) !important; }

.race-inline-wrap { position: relative !important; display: inline-block; }
.race-saved-check {
  visibility: hidden;
  position: absolute !important;
  inset: 0 !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
}
.btn.race-apply-btn {
  display: none;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  white-space: nowrap !important;
}
.race-apply-btn--bib { left: 76px !important; }
.race-apply-btn--paid { left: 84px !important; }

.race-dropdown {
  top: 100% !important; left: 0 !important; max-height: 180px !important;
  overflow-y: auto !important; z-index: 1050 !important; width: 100% !important;
}
.race-dropdown--tall { max-height: 220px !important; width: auto !important; }

.race-team-card {
  border-radius: 8px !important; overflow: hidden !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
}
.race-team-toggle--mine { background: rgba(25,135,84,0.05) !important; }
.race-members-border { border-top: 1px solid var(--color-shadow-soft) !important; }

/* An athlete's name links to their page (ATHLETES.md): it reads as the name did, an underline on hover. */
.res-name-link { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-name-link:hover { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* A race's generated files as tiles (RACE-WINORIENT.md, decision 10): a format badge, what the file is for,
   its format and size. Three in a row, one under another on a phone. A tile is a link, or a form button. */
.race-ftiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.race-ftiles form { display: contents; }
@media (max-width: 575.98px) { .race-ftiles { grid-template-columns: 1fr; gap: .5rem; } }
.race-ftile {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem .85rem; text-align: left;
  border: 1px solid var(--color-card-border); border-radius: .75rem; background: var(--color-card-bg);
  text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.race-ftile:hover { border-color: var(--color-border-strong); box-shadow: 0 .25rem .75rem var(--color-shadow-light); color: inherit; }
.race-ftile-body { min-width: 0; line-height: 1.25; }
.race-ftile-name { display: block; font-weight: 600; color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-ftile-sub { display: block; font-size: .8rem; color: var(--color-text-muted); }
.race-fbadge {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.6rem; height: 1.5rem;
  border-radius: .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .02em; color: #fff;
}
.race-fbadge-pdf { background: #d63939; }
.race-fbadge-csv { background: #2f9e44; }
.race-fbadge-xlsx { background: #1c7c3c; }
