.floating-bar {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgb(0 0 0 / 15%);
  font-size: var(--text-sm);
  max-width: calc(100vw - 2 * var(--space-md));
  flex-wrap: wrap;
  transition: width 0.3s ease;
}

.floating-bar--expanded {
  flex-direction: column;
  align-items: stretch;
}

.floating-bar__section {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.floating-bar__section--scoring {
  min-width: min(11rem, 50vw);
  flex: 1;
}

.floating-bar__tracks {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.floating-bar__progress {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.floating-bar__track {
  height: 4px;
  background: var(--color-surface-alt);
  border-radius: 2px;
  overflow: hidden;
}

.floating-bar__fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.floating-bar__subtrack {
  height: 3px;
  background: var(--color-surface-alt);
  border-radius: 1.5px;
  overflow: hidden;
}

.floating-bar__subfill {
  height: 100%;
  background: var(--color-success, #22c55e);
  border-radius: 1.5px;
  transition: width 0.15s ease;
}

.floating-bar__stats {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-bar__stats-line {
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-bar__stats-line + .floating-bar__stats-line::before {
  content: ' · ';
}

.floating-bar__stats--tappable {
  border: none;
  background: none;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.floating-bar--expanded .floating-bar__stats--tappable {
  background: none;
}

.floating-bar--expanded > .floating-bar__section,
.floating-bar--expanded > .floating-bar__pager {
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

.floating-bar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--color-primary);
}

.floating-bar__icon--muted {
  color: var(--color-text-muted);
}
