/* Dynamic team accent — defaults match legacy cyan theme */
:root {
  --jl-accent: #00d4ff;
  --jl-on-accent: #0b0b0f;
  --jl-accent-soft: rgba(0, 212, 255, 0.15);
  --jl-accent-border: rgba(0, 212, 255, 0.38);
  --jl-accent-muted: rgba(0, 212, 255, 0.55);
  --jl-accent-secondary: #EF3340;
}

/* Dash defaults leave a white page/body frame around the dark layout */
html, body {
  margin: 0;
  padding: 0;
  background: #0b0b0f;
  border: none;
}

#react-entry-point,
#_dash-app-content,
._dash-app-content,
.jl-site-root {
  background: #0b0b0f;
  border: none;
  box-shadow: none;
  outline: none;
}

.jl-themed-accent {
  color: var(--jl-accent) !important;
}

.jl-themed-border {
  border-color: var(--jl-accent) !important;
}

.jl-site-title {
  color: var(--jl-accent) !important;
}

.jl-player-headshot {
  border: 2px solid var(--jl-accent) !important;
}

.jl-pitch-section-title {
  color: var(--jl-accent) !important;
}

.jl-rolling-pitch .jl-rolling-header > div:first-child {
  color: var(--jl-accent) !important;
}

/* Main tabs */
.jl-site-root .tab--selected {
  color: var(--jl-accent) !important;
  border-top-color: var(--jl-accent) !important;
  border-left-color: var(--jl-accent) !important;
  border-right-color: var(--jl-accent) !important;
}

.jl-site-root .tab {
  border-color: #222 !important;
}

/* Player level filter buttons */
.jl-level-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--jl-accent);
  background-color: #1a1a24;
  color: #ccc;
}

.jl-level-btn-active {
  background-color: var(--jl-accent) !important;
  color: var(--jl-on-accent) !important;
}

/* Primary action buttons that should follow team color */
.jl-btn-accent {
  background-color: var(--jl-accent) !important;
  color: var(--jl-on-accent) !important;
  border: 1px solid var(--jl-accent) !important;
}

.jl-team-tile:hover {
  border-color: var(--jl-accent-border) !important;
}

.jl-team-tile:focus-visible {
  outline: 2px solid var(--jl-accent);
  outline-offset: 2px;
}

/* Scoped loading UI (matches R app roundel spinner) */
.scoped-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  min-height: 140px;
  gap: 0;
}

.scoped-loading-panel.is-compact {
  padding: 16px 12px;
  min-height: 110px;
}

.scoped-loading-panel.is-compact .scoped-loading-roundel-wrap {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
}

.scoped-loading-panel.is-compact .scoped-loading-roundel {
  width: 54px;
  height: 54px;
}

.scoped-loading-roundel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.scoped-loading-roundel-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--jl-accent, #00A3E0);
  border-right-color: var(--jl-accent-secondary, #EF3340);
  animation: scoped-ring-spin 0.85s linear infinite;
}

.scoped-loading-roundel {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #0b0b0f;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scoped-loading-logo {
  position: relative;
  width: 78%;
  height: 78%;
  background-image: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scoped-loading-jl-mark {
  font-family: "Arial Black", "Arial", sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--jl-accent, #00d4ff);
  line-height: 1;
  user-select: none;
}

/* Once a team is active, swap JL for that club's on-dark logo */
:root[data-theme-team] .scoped-loading-logo {
  background-image: var(--jl-loading-logo);
}

:root[data-theme-team] .scoped-loading-jl-mark {
  display: none;
}

.scoped-loading-title {
  margin: 0;
  color: #f2f2f2;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.scoped-loading-detail {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
}

.scoped-loading-panel.is-compact .scoped-loading-title {
  font-size: 15px;
}

.scoped-loading-panel.is-compact .scoped-loading-detail {
  font-size: 12px;
  margin-top: 6px;
}

/* Keep roster / profile spinners anchored near the top */
#roster-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.jl-roster-loading-parent,
.jl-loading-anchor {
  position: relative;
  min-height: 180px;
  margin-top: 4px;
}

.jl-roster-loading-parent .dash-spinner-container,
.jl-roster-loading-parent ._dash-loading,
.jl-roster-loading-parent .dash-loading,
.jl-loading-anchor .dash-spinner-container,
.jl-loading-anchor ._dash-loading,
.jl-loading-anchor .dash-loading {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 180px;
  transform: none !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: 12px;
  background: transparent !important;
  z-index: 5;
}

/* Player profile: keep spinner in document flow under the bio so action
   buttons sit cleanly below it instead of overlapping. */
.jl-player-loading {
  position: relative;
  min-height: 220px;
  margin: 8px auto 0;
  max-width: 1200px;
}

.jl-player-loading .dash-spinner-container,
.jl-player-loading ._dash-loading,
.jl-player-loading .dash-loading {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 200px;
  transform: none !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 12px 0 8px;
  background: transparent !important;
}

#player-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 160px;
}

#player-actions button {
  width: 100%;
  white-space: nowrap;
}

.jl-player-header {
  width: 100%;
}

@keyframes scoped-ring-spin {
  to {
    transform: rotate(360deg);
  }
}
