/* /tools/minecraft-server-properties-generator/ : every rule is scoped to .mcprops so sister tools are unaffected. */

.mcprops .mcp-app[hidden], .mcprops [hidden] { display: none !important; }

.mcprops .mcp-tool { margin: 1.75rem 0 2.5rem; }

/* On wide screens the tool breaks out of the narrow reading column so the file sits beside the form. */
.mcprops .mcp-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .mcprops .mcp-tool {
    width: min(70rem, calc(100vw - 3rem));
    margin-left: calc((100% - min(70rem, calc(100vw - 3rem))) / 2);
  }
  .mcprops .mcp-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .mcprops .mcp-out { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .mcprops .mcp-skip { display: none; }
}

.mcprops .mcp-form { min-width: 0; }
.mcprops .mcp-form fieldset,
.mcprops .mcp-out {
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  background: var(--surface);
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
  min-width: 0;
}
.mcprops .mcp-out { margin: 0; }
.mcprops .mcp-out .mcp-mode { border: 0; padding: 0; margin: 0 0 1rem; background: none; }
/* Float the legend so it sits inside the box rather than on its border. */
.mcprops legend {
  float: left;
  width: 100%;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0;
  margin: 0 0 .35rem;
  color: var(--text);
}
.mcprops legend + * { clear: both; }
.mcprops .mcp-mode legend { font-size: 1rem; }
.mcprops .mcp-out h3 { margin-top: 0; }

.mcprops .mcp-field { margin: 1rem 0 0; }
.mcprops .mcp-field:first-of-type { margin-top: .5rem; }
.mcprops .mcp-field > label {
  display: block;
  font-weight: 650;
  margin-bottom: .3rem;
  overflow-wrap: anywhere;
}
.mcprops .mcp-field label code,
.mcprops .mcp-radios label code { font-weight: 400; font-size: .82em; overflow-wrap: anywhere; }

.mcprops .mcp-field input[type="text"],
.mcprops .mcp-field input[type="number"],
.mcprops .mcp-field select,
.mcprops .mcp-field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: .6rem .75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 2.75rem;
}
.mcprops .mcp-field input[type="number"] { max-width: 14rem; }
.mcprops .mcp-field textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
  min-height: 4.2rem;
}
.mcprops .mcp-field input:hover,
.mcprops .mcp-field select:hover,
.mcprops .mcp-field textarea:hover { border-color: var(--muted); }
.mcprops input:focus-visible,
.mcprops select:focus-visible,
.mcprops textarea:focus-visible,
.mcprops button:focus-visible,
.mcprops pre:focus-visible,
.mcprops .mcp-out:focus-visible,
.mcprops a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Checkbox rows: box on the left, label and help text beside it. */
.mcprops .mcp-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: .7rem;
  align-items: start;
}
.mcprops .mcp-check input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: .2rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.mcprops .mcp-check > label { margin: 0; cursor: pointer; }
.mcprops .mcp-check > .mcp-help,
.mcprops .mcp-check > .mcp-alert { grid-column: 2; }

.mcprops .mcp-radios label {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin: .4rem 0 0;
  cursor: pointer;
}
.mcprops .mcp-radios input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: .25rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.mcprops .mcp-help { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }
.mcprops .mcp-adjust { font-size: .9rem; margin: .35rem 0 0; color: #92400e; font-weight: 600; }
.mcprops .mcp-alert {
  margin: .6rem 0 0;
  padding: .65rem .85rem;
  border-radius: 8px;
  border: 1px solid #b91c1c;
  background: color-mix(in srgb, #dc2626 9%, var(--surface));
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
}
.mcprops .mcp-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .05rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: .1em;
  white-space: nowrap;
}

.mcprops .mcp-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.mcprops .mcp-buttons .btn { margin: 0; }
.mcprops .mcp-presets .btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.mcprops .mcp-status { min-height: 1.5em; margin: .5rem 0 0; font-size: .95rem; font-weight: 600; color: var(--good); }
.mcprops .mcp-skip { margin: .25rem 0 0; }

.mcprops .mcp-warnings {
  margin: 0 0 1rem;
  padding: .7rem .9rem .7rem 2rem;
  border: 1px solid #d99a00;
  border-radius: 8px;
  background: color-mix(in srgb, #ffb400 12%, var(--surface));
  color: var(--text);
  font-size: .92rem;
}
.mcprops .mcp-warnings li { margin: .15rem 0; }

/* The file preview scrolls inside itself; the page never scrolls sideways. */
.mcprops .mcp-pre {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  max-height: 26rem;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.5;
  padding: .9rem 1rem;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--border);
  tab-size: 4;
}
.mcprops .mcp-pre-rules { max-height: none; }
.mcprops .mcp-rules { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.mcprops .mcp-rules h3 { font-size: 1.05rem; margin: 0 0 .25rem; }

.mcprops .mcp-offscreen { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.mcprops .compare code { white-space: nowrap; }

@media (max-width: 480px) {
  .mcprops .mcp-form fieldset, .mcprops .mcp-out { padding: .9rem .9rem 1rem; }
  .mcprops .mcp-buttons .btn { flex: 1 1 auto; justify-content: center; }
  .mcprops .mcp-field input[type="number"] { max-width: none; }
}

/* Dark theme: the site switches with html[data-theme="dark"]. */
html[data-theme="dark"] .mcprops .mcp-adjust { color: #fbbf24; }
html[data-theme="dark"] .mcprops .mcp-alert { border-color: #f87171; background: color-mix(in srgb, #ef4444 16%, var(--surface)); }
html[data-theme="dark"] .mcprops .mcp-warnings { border-color: #b98300; background: color-mix(in srgb, #ffb400 10%, var(--surface)); }
html[data-theme="dark"] .mcprops .mcp-pre { background: #0d1428; }
html[data-theme="dark"] .mcprops legend { color: #fff; }
html[data-theme="dark"] .mcprops .mcp-field input:hover,
html[data-theme="dark"] .mcprops .mcp-field select:hover,
html[data-theme="dark"] .mcprops .mcp-field textarea:hover { border-color: rgba(255, 255, 255, .35); }
