/* ==========================================================================
   Tool pages. Loaded only on /tools/<tool>/ pages.
   Built from the existing tokens and components; no new colours or radii.
   ========================================================================== */

/* ---- Page header (compact, so the tool appears early) --------------------- */

.page-header--tool {
  padding-block: var(--space-6) var(--space-6);
}

@media (min-width: 48em) {
  .page-header--tool {
    padding-block: var(--space-7) var(--space-7);
  }

  .page-header--tool h1 {
    font-size: var(--text-4xl);
    line-height: var(--leading-4xl);
    letter-spacing: var(--tracking-4xl);
  }
}

/* ---- Tool layout ------------------------------------------------------------- */

.tool-section {
  padding-block: var(--space-6) var(--space-8);
}

@media (min-width: 48em) {
  .tool-section {
    padding-block: var(--space-7) var(--space-9);
  }
}

.tool-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 64em) {
  .tool-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
  }

  .tool-grid--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .tool-grid--sticky > :first-child {
    position: sticky;
    top: var(--space-5);
  }
}

.tool-stack {
  display: grid;
  gap: var(--space-6);
}

.tool-form {
  display: grid;
  gap: var(--space-5);
}

.tool-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.tool-output {
  min-width: 0;
}

.tool-output > * + * {
  margin-top: var(--space-6);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: var(--space-4);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  border-top: var(--border-thin) dashed var(--ink-subtle);
}

/* ---- Choices (radio groups styled as a row of options) --------------------- */

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choice legend {
  margin-bottom: var(--space-2);
  padding: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-bold);
}

.choice__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice__option {
  position: relative;
  display: inline-flex;
}

.choice__option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.choice__option span {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.choice__option:hover span {
  border-color: var(--green-dark);
  box-shadow: inset 0 -3px 0 var(--amber);
}

.choice__option input:checked + span {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green-dark);
  box-shadow: 0 var(--depth-1) 0 var(--green-dark);
}

.choice__option input:focus-visible + span {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.choice__option input:disabled + span {
  color: var(--ink-subtle);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}

/* Selected but locked: keep it readable and marked by a bar, not colour alone. */
.choice__option input:checked:disabled + span {
  color: var(--ink);
  background: var(--cream-sunken);
  border-color: var(--ink-subtle);
  box-shadow: inset 4px 0 0 var(--green);
}

/* Checkbox */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
}

.check input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.check input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* File input */
.file-input {
  width: 100%;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.file-input::file-selector-button {
  margin-right: var(--space-3);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-weight: var(--weight-bold);
  color: var(--green-dark);
  background: var(--cream-raised);
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-primary-active);
  cursor: pointer;
}

.file-input:hover::file-selector-button {
  background: var(--cream-sunken);
}

.file-input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Colour input paired with a hex text field */
.color-field {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.color-field input[type='color'] {
  flex: none;
  width: 3rem;
  min-height: 3rem;
  padding: var(--space-1);
  background: var(--cream-raised);
  border: var(--border-width) solid var(--color-border-control);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.color-field input[type='color']:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.color-field .input {
  min-width: 0;
}

/* ---- States (extends .state from components.css) ------------------------- */

.state--loading {
  border-style: solid;
  border-color: var(--line);
}

.state--notice {
  border-style: solid;
  border-color: var(--line);
  border-left: 6px solid var(--amber);
}

.state__details {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.state__details summary {
  cursor: pointer;
  font-weight: var(--weight-bold);
}

.state__details summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.state__details code {
  display: inline-block;
  margin-top: var(--space-2);
  overflow-wrap: anywhere;
}

/* Three blocks stepping in turn. */
.loader {
  display: inline-flex;
  gap: 6px;
}

.loader span {
  width: 10px;
  height: 10px;
  background: var(--amber);
  box-shadow: 2px 2px 0 var(--amber-dark);
  animation: loader-step 0.9s steps(1, end) infinite;
}

.loader span:nth-child(2) { animation-delay: 0.3s; }
.loader span:nth-child(3) { animation-delay: 0.6s; }

@keyframes loader-step {
  0%, 100% { transform: translateY(0); }
  33% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .loader span { animation: none; }
}

/* ---- Result header ----------------------------------------------------------- */

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}

.result-head__media {
  flex: none;
}

.result-head__text {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.result-head__title {
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  letter-spacing: var(--tracking-2xl);
  overflow-wrap: anywhere;
}

.result-head__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---- Data list: label, value, copy ------------------------------------------- */

.data-list {
  margin: 0;
  border-top: var(--border-width) solid var(--green-dark);
}

.data-list__row {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-3);
  border-bottom: var(--border-thin) solid var(--line);
}

.data-list__row dt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.data-list__row dd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  min-width: 0;
}

.data-list__value {
  min-width: 0;
  font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}

.data-list__value.text-mono {
  font-size: var(--text-sm);
}

@media (min-width: 40em) {
  .data-list__row {
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: center;
    gap: var(--space-4);
  }

  .data-list__value.text-mono {
    font-size: var(--text-base);
  }

  .media-row .data-list__row {
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }
}

/* ---- Copy button ----------------------------------------------------------------
   Both labels occupy the same grid cell so the width never changes. */

.copy-btn {
  display: inline-grid;
  flex: none;
}

.copy-btn__label {
  grid-area: 1 / 1;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.copy-btn__label--done {
  opacity: 0;
}

.copy-btn.is-copied {
  --btn-bg: var(--green);
  --btn-fg: var(--cream);
  --btn-bg-hover: var(--green);
}

.copy-btn.is-copied .copy-btn__label {
  opacity: 0;
}

.copy-btn.is-copied .copy-btn__label--done {
  opacity: 1;
}

/* ---- Previews ------------------------------------------------------------------ */

.pixelated {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Two-tone squares show image transparency without adding colour. */
.checker {
  background-color: var(--cream-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath fill='%23f4edcc' d='M0 0h8v8H0zM8 8h8v8H8z'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}

.preview-frame {
  display: grid;
  place-items: center;
  padding: var(--space-4);
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-md);
}

.preview-frame img,
.preview-frame canvas {
  max-width: 100%;
  height: auto;
}

.avatar {
  width: 64px;
  height: 64px;
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-sm);
  box-shadow: 0 var(--depth-1) 0 var(--green-dark);
  background: var(--cream-sunken);
}

.media-row {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 40em) {
  .media-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
}

.media-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ---- Code output ------------------------------------------------------------------ */

.code-output {
  display: grid;
  gap: var(--space-3);
}

.code-output__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.code-output__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.code-output pre {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  padding: var(--space-4);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
}

.code-output pre:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.code-output__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---- Game text ---------------------------------------------------------------------- */

.game-surface {
  padding: var(--space-4);
  color: #ffffff;
  background: var(--game-surface);
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--game-surface-line);
  overflow-wrap: anywhere;
}

.game-text {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: 1.5;
  font-weight: var(--weight-medium);
  white-space: pre-wrap;
  min-height: 1.5em;
}

.game-text--empty {
  color: #9a9a92;
  font-style: italic;
}

.mc-bold { font-weight: var(--weight-heavy); }
.mc-italic { font-style: italic; }
.mc-underlined { text-decoration: underline; text-decoration-thickness: 0.1em; }
.mc-strike { text-decoration: line-through; text-decoration-thickness: 0.1em; }
.mc-underlined-strike { text-decoration: underline line-through; }
.mc-obfuscated { font-family: var(--font-mono); }

/* Server list entry */
.server-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.server-entry__icon {
  width: 64px;
  height: 64px;
  background: #2b2b28;
  border: 1px solid var(--game-surface-line);
}

.server-entry__icon--placeholder {
  display: grid;
  place-items: center;
  color: #8a8a82;
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
}

.server-entry__name {
  color: #ffffff;
  font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}

.server-entry__motd {
  font-size: var(--text-base);
}

/* ---- Swatches and code chips ------------------------------------------------------- */

.toolbar {
  display: grid;
  gap: var(--space-3);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.swatch {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-sm);
  box-shadow: 0 var(--depth-1) 0 var(--green-dark);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-2) 0 var(--green-dark);
}

.swatch:active {
  transform: translateY(1px);
  box-shadow: none;
}

.swatch-static {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
  border: var(--border-thin) solid var(--green-dark);
  border-radius: 2px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: var(--space-1) var(--space-3);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.code-chip:hover {
  border-color: var(--green-dark);
  box-shadow: inset 0 -3px 0 var(--amber);
}

.code-chip:active {
  background: var(--cream-sunken);
}

.code-chip.is-copied {
  color: var(--cream);
  background: var(--green);
  border-color: var(--green-dark);
}

.ref-table .game-surface {
  padding: var(--space-1) var(--space-3);
  box-shadow: none;
  border-width: var(--border-thin);
}

.ref-table .game-text {
  font-size: var(--text-base);
}

/* ---- Coordinates ------------------------------------------------------------------------ */

.coords {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.coords__cell {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.coords__axis {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-xs);
  text-transform: uppercase;
  font-weight: var(--weight-heavy);
}

.coords__value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}

.coords__note {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.result-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--cream-raised);
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-md);
}

.result-card__title {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

/* Long values (huge numbers, hostnames) must wrap instead of widening the card. */
.result-card > *,
.tool-stack > *,
.code-output > * {
  min-width: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Chunk map: 16 by 16 blocks, north at the top. */
.chunk-map {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
}

.chunk-map__grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  width: min(100%, 18rem);
  aspect-ratio: 1;
  background: var(--cream-raised);
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.chunk-map__cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chunk-map__cell.is-row,
.chunk-map__cell.is-col {
  background: var(--cream-sunken);
}

.chunk-map__cell.is-target {
  background: var(--amber);
  box-shadow: inset 0 0 0 2px var(--amber-dark);
}

.chunk-map__caption {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-align: center;
}

/* Big figures */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
  gap: var(--space-3);
  margin: 0;
}

.figure {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.figure dt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.figure dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}

.figure--lead {
  grid-column: 1 / -1;
  background: var(--green);
  border-color: var(--green-dark);
  box-shadow: 0 var(--depth-2) 0 var(--green-dark);
}

.figure--lead dt,
.figure--lead dd {
  color: var(--cream);
}

.figure--lead dd {
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
}

/* ---- Gradient stops -------------------------------------------------------------------- */

.stops {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: end;
}

/* ---- 3D skin viewer ----------------------------------------------------------------------- */

.skin3d {
  /* Zoom scales the texel size itself, so pixels stay crisp instead of being resampled. */
  --px-base: 9px;
  --px: calc(var(--px-base) * var(--zoom));
  --zoom: 1;
  --yaw: -30deg;
  --pitch: -12deg;
  position: relative;
  height: 26rem;
  overflow: hidden;
  perspective: 1600px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  border: var(--border-width) solid var(--green-dark);
  border-radius: var(--radius-md);
}

@media (min-width: 30em) {
  .skin3d { --px-base: 11px; height: 30rem; }
}

.skin3d.is-dragging {
  cursor: grabbing;
}

.skin3d:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skin3d__scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--pitch)) rotateY(var(--yaw));
}

.skin3d__part,
.skin3d__layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
}

.skin3d__part {
  transform: translate3d(calc(var(--x) * var(--px)), calc(var(--y) * var(--px)), calc(var(--z) * var(--px)));
}

.skin3d__face {
  position: absolute;
  width: calc(var(--fw) * var(--px));
  height: calc(var(--fh) * var(--px));
  margin-left: calc(var(--fw) * var(--px) / -2);
  margin-top: calc(var(--fh) * var(--px) / -2);
  background-image: var(--skin);
  background-repeat: no-repeat;
  background-size: calc(64 * var(--px) * var(--kx)) calc(64 * var(--px) * var(--ky));
  background-position: calc(var(--u) * var(--px) * var(--kx) * -1) calc(var(--v) * var(--px) * var(--ky) * -1);
  image-rendering: pixelated;
  backface-visibility: hidden;
  transform: var(--t);
}

.skin3d--no-overlay .skin3d__layer--overlay {
  display: none;
}

.viewer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.range-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.range-field input {
  accent-color: var(--green);
}

.range-field input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* ---- Below the tool ---------------------------------------------------------------------- */

.tool-about {
  padding-block: var(--space-8);
  border-top: var(--border-width) solid var(--line);
}

.tool-about .prose h2:first-child {
  margin-top: 0;
}

.tool-about__grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 64em) {
  .tool-about__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-8);
    align-items: start;
  }
}

.result-section {
  gap: var(--space-4);
  padding-top: var(--space-2);
}

.result-section .section-title + * {
  margin-top: 0;
}

/* ---- Minecraft colour classes (static examples; the renderer sets colours directly) */

.mc-c-0 { color: #000000; text-shadow: 0.1em 0.1em 0 #000000; }
.mc-c-1 { color: #0000aa; text-shadow: 0.1em 0.1em 0 #00002a; }
.mc-c-2 { color: #00aa00; text-shadow: 0.1em 0.1em 0 #002a00; }
.mc-c-3 { color: #00aaaa; text-shadow: 0.1em 0.1em 0 #002a2a; }
.mc-c-4 { color: #aa0000; text-shadow: 0.1em 0.1em 0 #2a0000; }
.mc-c-5 { color: #aa00aa; text-shadow: 0.1em 0.1em 0 #2a002a; }
.mc-c-6 { color: #ffaa00; text-shadow: 0.1em 0.1em 0 #3f2a00; }
.mc-c-7 { color: #aaaaaa; text-shadow: 0.1em 0.1em 0 #2a2a2a; }
.mc-c-8 { color: #555555; text-shadow: 0.1em 0.1em 0 #151515; }
.mc-c-9 { color: #5555ff; text-shadow: 0.1em 0.1em 0 #15153f; }
.mc-c-a { color: #55ff55; text-shadow: 0.1em 0.1em 0 #153f15; }
.mc-c-b { color: #55ffff; text-shadow: 0.1em 0.1em 0 #153f3f; }
.mc-c-c { color: #ff5555; text-shadow: 0.1em 0.1em 0 #3f1515; }
.mc-c-d { color: #ff55ff; text-shadow: 0.1em 0.1em 0 #3f153f; }
.mc-c-e { color: #ffff55; text-shadow: 0.1em 0.1em 0 #3f3f15; }
.mc-c-f { color: #ffffff; text-shadow: 0.1em 0.1em 0 #3f3f3f; }

.swatch.mc-c-0, .swatch-static.mc-c-0 { background: #000000; }
.swatch.mc-c-1, .swatch-static.mc-c-1 { background: #0000aa; }
.swatch.mc-c-2, .swatch-static.mc-c-2 { background: #00aa00; }
.swatch.mc-c-3, .swatch-static.mc-c-3 { background: #00aaaa; }
.swatch.mc-c-4, .swatch-static.mc-c-4 { background: #aa0000; }
.swatch.mc-c-5, .swatch-static.mc-c-5 { background: #aa00aa; }
.swatch.mc-c-6, .swatch-static.mc-c-6 { background: #ffaa00; }
.swatch.mc-c-7, .swatch-static.mc-c-7 { background: #aaaaaa; }
.swatch.mc-c-8, .swatch-static.mc-c-8 { background: #555555; }
.swatch.mc-c-9, .swatch-static.mc-c-9 { background: #5555ff; }
.swatch.mc-c-a, .swatch-static.mc-c-a { background: #55ff55; }
.swatch.mc-c-b, .swatch-static.mc-c-b { background: #55ffff; }
.swatch.mc-c-c, .swatch-static.mc-c-c { background: #ff5555; }
.swatch.mc-c-d, .swatch-static.mc-c-d { background: #ff55ff; }
.swatch.mc-c-e, .swatch-static.mc-c-e { background: #ffff55; }
.swatch.mc-c-f, .swatch-static.mc-c-f { background: #ffffff; }

.game-chip {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  background: var(--game-surface);
  border-radius: var(--radius-sm);
}

.format-button {
  min-width: 2.25rem;
  font-family: var(--font-mono);
}

.head-preview {
  min-height: 18rem;
}

.head-preview__canvas {
  width: auto;
  max-width: min(100%, 256px);
}

.reference {
  display: grid;
  gap: var(--space-8);
}

.reference__block {
  display: grid;
  gap: var(--space-4);
}

.reference__block > p {
  max-width: 44rem;
  color: var(--color-text-muted);
}

.ref-table--narrow {
  min-width: 0;
  max-width: 28rem;
}

/* Offline: a flat dash instead of a square, so it differs by shape as well as text. */
.status--offline::before {
  height: 3px;
  background: var(--ink-subtle);
  box-shadow: none;
}

.result-head__meta .status {
  margin-right: var(--space-1);
  vertical-align: middle;
}

.player-sample {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-sample li {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  background: var(--cream-raised);
  border: var(--border-thin) solid var(--ink-subtle);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.coords--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 29.99em) {
  .coords {
    grid-template-columns: minmax(0, 1fr);
  }

  .coords--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chunk-layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 40em) {
  .chunk-layout {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.chunk-map__grid {
  width: min(100%, 14rem);
}

.chunk-map {
  margin: 0;
}

.data-list-wrap {
  display: grid;
  gap: var(--space-3);
}

.codes-input {
  resize: vertical;
  min-height: 6rem;
}

.motd-warning {
  margin: 0;
}

.motd-preview-note {
  margin-top: var(--space-2);
}

.gradient-helper {
  display: grid;
  gap: var(--space-3);
}

/* ---- Whitelist Creator --------------------------------------------------------------- */

.whitelist-input {
  resize: vertical;
  min-height: 9rem;
}

/* ---- server.properties Generator -------------------------------------------------------
   A long settings form next to its output: the output column stays in view instead. */

/* Number inputs size themselves from their max value; let the columns shrink anyway. */
.tool-grid--sticky-output > *,
.tool-grid--sticky-output .tool-form > * {
  min-width: 0;
}

.tool-grid--sticky-output .tool-form {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 64em) {
  .tool-grid--sticky-output > :last-child {
    position: sticky;
    top: var(--space-5);
  }
}

.code-output--tall pre {
  max-height: min(70vh, 42rem);
}

/* Long keys and environment variable names in help text wrap instead of widening the form. */
.field__hint code,
.tool-grid--sticky-output .field__hint {
  overflow-wrap: anywhere;
}

.tool-grid--sticky-output .field > * {
  min-width: 0;
}
