/* Player Docs */

/* Hide components before defined */
fortyfour-player:not(:defined) {
  visibility: hidden;
}

/* Example Block */
.example-block {
  margin-bottom: 1.5rem;
}

.example-block__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ff-text);
  margin: 0 0 0.125rem;
}

.example-block__desc {
  font-size: 0.75rem;
  color: var(--ff-muted);
  margin: 0 0 0.5rem;
}

.example-block__desc code {
  font-family: var(--ff-font-mono);
  font-size: 0.8125em;
  background: var(--ff-accent-subtle);
  color: var(--ff-accent);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.example-block__desc a {
  color: var(--ff-accent);
  text-decoration: none;
}

.example-block__desc a:hover {
  text-decoration: underline;
}

/* Example Preview */
.example-preview {
  padding: 1rem;
  background: var(--ff-bg-subtle);
  border: 1px solid var(--ff-border);
  border-radius: 6px;
}

.example-preview--dark {
  background: #111827;
}

/* Player Stack (Examples page) */
.player-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.player-stack__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-stack__label {
  font-size: 0.6875rem;
  color: var(--ff-muted);
  font-family: var(--ff-font-mono);
}

/* Back to Top */
.back-to-top {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ff-border);
  text-align: center;
}

.back-to-top__link {
  font-size: 0.8125rem;
  color: var(--ff-muted);
  text-decoration: none;
}

.back-to-top__link:hover {
  color: var(--ff-text);
}

/* Playground */
.playground {
  margin-top: 1.5rem;
}

.playground--split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .playground--split {
    grid-template-columns: 1fr;
  }
}

.playground__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.playground__section {
  background: var(--ff-bg-subtle);
  border: 1px solid var(--ff-border);
  border-radius: 6px;
  padding: 1rem;
}

.playground__section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ff-text);
  margin: 0 0 0.25rem;
}

.playground__section-desc {
  font-size: 0.75rem;
  color: var(--ff-muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.playground__section-desc a {
  color: var(--ff-accent);
  text-decoration: none;
}

.playground__section-desc a:hover {
  text-decoration: underline;
}

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

.playground__fields--stacked {
  gap: 0.5rem;
}

.playground__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.playground__label {
  font-size: 0.6875rem;
  color: var(--ff-muted);
  font-weight: 500;
}

.playground__range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.playground__range input[type="range"] {
  flex: 1;
  accent-color: var(--ff-accent);
}

.playground__range-value {
  font-size: 0.75rem;
  color: var(--ff-muted);
  font-family: var(--ff-font-mono);
  min-width: 4ch;
  text-align: right;
}

.playground__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ff-text);
  cursor: pointer;
}

.playground__checkbox input[type="checkbox"] {
  accent-color: var(--ff-accent);
}

.playground__reset {
  align-self: flex-start;
}

.playground__main {
  display: flex;
  flex-direction: column;
}

.playground__tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--ff-border);
}

.playground__tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ff-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.playground__tab:hover {
  color: var(--ff-text);
}

.playground__tab--active {
  color: var(--ff-text);
  border-bottom-color: var(--ff-accent);
}

.playground__preview {
  /* No sticky needed with tabs */
}

.playground__code-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.playground__radio {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--ff-text);
  cursor: pointer;
}

.playground__radio input[type="radio"] {
  accent-color: var(--ff-accent);
}

.playground__color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.playground__color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.playground__color-label {
  font-size: 0.6875rem;
  color: var(--ff-muted);
  width: 9ch;
}

.playground__color input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ff-border);
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.playground__color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.playground__color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.playground__randomize {
  margin-top: 0.75rem;
  width: 100%;
  justify-content: center;
}

.playground__code-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ff-text);
  margin: 0 0 0.25rem;
}

.playground__code-description {
  font-size: 0.8125rem;
  color: var(--ff-muted);
  margin: 0 0 1rem;
}

.playground__code-description a {
  color: var(--ff-accent);
  text-decoration: none;
}

.playground__code-description a:hover {
  text-decoration: underline;
}

.playground__code pre {
  margin: 0;
}

.playground__code code {
  font-size: 0.8125rem;
}
