/*
 * The playground (holoml #58): the editor and the scene side by side, the
 * editor above on a narrow screen. Only the site's own colour tokens
 * (style.css), so its contrast is what site/site.test.ts checks.
 */
body.playground main {
  max-width: 90rem;
}

.pg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .pg-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pg-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.pg-tools h2 {
  margin: 0 auto 0 0;
  font-size: 1.15rem;
}

.pg-tools select,
.pg-tools button {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

.pg-tools button {
  cursor: pointer;
}

.pg-tools button:disabled {
  cursor: default;
  color: var(--muted);
}

.pg-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pg-code {
  display: flex;
  height: 30rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.pg-lines,
.pg-code textarea {
  margin: 0;
  padding: 0.5rem;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  tab-size: 2;
}

.pg-lines {
  flex: none;
  min-width: 3.5em;
  text-align: right;
  color: var(--muted);
  background: var(--bg);
  border-right: 1px solid var(--rule);
  overflow: hidden;
  user-select: none;
  white-space: pre;
}

.pg-lines .pg-marked {
  color: var(--must);
  font-weight: 700;
}

.pg-code textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  color: var(--fg);
  background: var(--surface);
  white-space: pre;
  overflow: auto;
}

.pg-code textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.pg-keys {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.pg-count.pg-bad {
  color: var(--must);
  font-weight: 600;
}

.pg-problems {
  padding-left: 1.25rem;
}

.pg-problem {
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: none;
  border: 0;
  padding: 0.15rem 0;
  cursor: pointer;
}

.pg-problem:hover .pg-where,
.pg-problem:focus-visible .pg-where {
  text-decoration: underline;
}

.pg-where {
  color: var(--must);
  font-weight: 600;
}

.pg-frame {
  height: 36rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.pg-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pg-stale .pg-frame {
  opacity: 0.45;
}

.pg-note {
  margin: 0 0 0.5rem;
  color: var(--fg);
  background: var(--surface);
  border-left: 4px solid var(--must);
  padding: 0.4rem 0.75rem;
}
