/* THOST Minecraft MOTD maker (/tools/minecraft-motd-maker/). Every rule is scoped to .mcmotd.
   The preview row stays dark in both themes, like the game's server list. No game assets: plain CSS
   and a monospace font stack. */

.mcmotd [hidden] { display: none !important; }
.mcmotd .mcmotd-nojs { margin-top: 1.25rem; }

/* Editor panel */
.mcmotd .mcmotd-app { margin: 1.5rem 0 2.5rem; }
.mcmotd .mcmotd-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 12px); padding: 1.1rem 1.1rem .4rem; box-shadow: var(--shadow); }
.mcmotd .mcmotd-field { margin-bottom: .9rem; min-width: 0; }
.mcmotd .mcmotd-field > label, .mcmotd .mcmotd-out > label { display: block; font-weight: 700; margin-bottom: .3rem; }
.mcmotd .mcmotd-inrow { display: flex; gap: .5rem; align-items: stretch; min-width: 0; }
.mcmotd .mcmotd-input { flex: 1 1 auto; min-width: 0; width: 100%; padding: .65rem .8rem; font: inherit; font-size: 1rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; }
.mcmotd input.mcmotd-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.mcmotd select.mcmotd-input { cursor: pointer; }
.mcmotd .mcmotd-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.mcmotd .mcmotd-width { margin: .3rem 0 0; color: var(--muted); }
.mcmotd .mcmotd-width.is-warn { color: #b45309; font-weight: 600; }
html[data-theme="dark"] .mcmotd .mcmotd-width.is-warn { color: #fbbf24; }

/* Small utility buttons: centre, load, clear */
.mcmotd .mcmotd-mini { flex: 0 0 auto; font: inherit; font-size: .92rem; font-weight: 600; padding: .5rem .8rem; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface-2, var(--bg-alt)); color: var(--text); cursor: pointer; white-space: nowrap; }
.mcmotd .mcmotd-mini:hover { border-color: var(--accent); }
.mcmotd .mcmotd-mini:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Toolbar */
.mcmotd .mcmotd-tools { margin: .2rem 0 1rem; }
.mcmotd .mcmotd-tools-h { font-weight: 700; margin: 0 0 .4rem; }
.mcmotd .mcmotd-swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; max-width: 34rem; }
.mcmotd .mcmotd-sw { min-height: 2.5rem; border-radius: 8px; border: 2px solid rgba(13, 20, 40, .25); cursor: pointer; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: .95rem; padding: 0; }
html[data-theme="dark"] .mcmotd .mcmotd-sw { border-color: rgba(255, 255, 255, .3); }
.mcmotd .mcmotd-sw:hover { transform: translateY(-1px); border-color: var(--accent); }
.mcmotd .mcmotd-sw:focus-visible, .mcmotd .mcmotd-fmt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mcmotd .mcmotd-formats { display: flex; flex-wrap: wrap; gap: .4rem; }
.mcmotd .mcmotd-fmt { font: inherit; font-size: .95rem; padding: .45rem .75rem; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface-2, var(--bg-alt)); color: var(--text); cursor: pointer; }
.mcmotd .mcmotd-fmt:hover { border-color: var(--accent); }
.mcmotd .mcmotd-fmt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); font-size: .85em; }
.mcmotd .mcmotd-fmt-l .mcmotd-fmt-name { font-weight: 800; }
.mcmotd .mcmotd-fmt-o .mcmotd-fmt-name { font-style: italic; }
.mcmotd .mcmotd-fmt-n .mcmotd-fmt-name { text-decoration: underline; }
.mcmotd .mcmotd-fmt-m .mcmotd-fmt-name { text-decoration: line-through; }
.mcmotd .mcmotd-extras { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; border-top: 1px solid var(--border); padding-top: .9rem; }
.mcmotd .mcmotd-extras .mcmotd-ex { flex: 1 1 18rem; }
.mcmotd .mcmotd-extras .mcmotd-name { flex: 1 1 14rem; }
.mcmotd .mcmotd-extras > .mcmotd-mini { margin-bottom: .9rem; }

/* Preview: always dark, like the in-game server list */
.mcmotd .mcmotd-stage { background: #15161b; background-image: linear-gradient(180deg, #1d1f26, #121318); border: 1px solid #2c2f38; border-radius: 12px; padding: 1rem; overflow-x: auto; margin: .25rem 0 .6rem; color-scheme: dark; }
.mcmotd .mcmotd-row { display: flex; gap: .75rem; align-items: flex-start; min-width: 31rem; max-width: 40rem; padding: .35rem; border: 2px solid #8b8b8b; background: rgba(0, 0, 0, .55); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace; font-size: 1rem; line-height: 1.45; }
.mcmotd .mcmotd-icon { flex: 0 0 auto; width: 4.35rem; height: 4.35rem; border-radius: 4px; background: #3b3f4a; background-image: linear-gradient(135deg, #4b5160 0 50%, #3a3e49 50% 100%); display: flex; align-items: center; justify-content: center; }
.mcmotd .mcmotd-icon span { width: 45%; height: 45%; border-radius: 3px; background: #6b7080; box-shadow: inset 0 0 0 3px #555a68; }
.mcmotd .mcmotd-lines { min-width: 0; padding-top: .05rem; }
.mcmotd .mcmotd-pv-name { color: #ffffff; text-shadow: .1em .1em 0 #3f3f3f; white-space: pre; }
.mcmotd .mcmotd-pv-line { white-space: pre; min-height: 1.45em; }
.mcmotd .mcmotd-pv-line span { white-space: pre; }
.mcmotd .mcmotd-pv-line .is-b { font-weight: 800; }
.mcmotd .mcmotd-pv-line .is-i { font-style: italic; }
.mcmotd .mcmotd-pv-line .is-u { text-decoration-line: underline; }
.mcmotd .mcmotd-pv-line .is-s { text-decoration-line: line-through; }
.mcmotd .mcmotd-pv-line .is-u.is-s { text-decoration-line: underline line-through; }
.mcmotd .mcmotd-pv-line span { text-decoration-thickness: .1em; text-underline-offset: .15em; }

/* The 16 colours (Java Edition RGB). Text shadow is the colour at a quarter brightness, as in the game. */
.mcmotd .mcmotd-c-def { color: #808080; text-shadow: .1em .1em 0 #202020; }
.mcmotd .mcmotd-c-0 { color: #000000; text-shadow: .1em .1em 0 #000000; }
.mcmotd .mcmotd-c-1 { color: #0000AA; text-shadow: .1em .1em 0 #00002A; }
.mcmotd .mcmotd-c-2 { color: #00AA00; text-shadow: .1em .1em 0 #002A00; }
.mcmotd .mcmotd-c-3 { color: #00AAAA; text-shadow: .1em .1em 0 #002A2A; }
.mcmotd .mcmotd-c-4 { color: #AA0000; text-shadow: .1em .1em 0 #2A0000; }
.mcmotd .mcmotd-c-5 { color: #AA00AA; text-shadow: .1em .1em 0 #2A002A; }
.mcmotd .mcmotd-c-6 { color: #FFAA00; text-shadow: .1em .1em 0 #3F2A00; }
.mcmotd .mcmotd-c-7 { color: #AAAAAA; text-shadow: .1em .1em 0 #2A2A2A; }
.mcmotd .mcmotd-c-8 { color: #555555; text-shadow: .1em .1em 0 #151515; }
.mcmotd .mcmotd-c-9 { color: #5555FF; text-shadow: .1em .1em 0 #15153F; }
.mcmotd .mcmotd-c-a { color: #55FF55; text-shadow: .1em .1em 0 #153F15; }
.mcmotd .mcmotd-c-b { color: #55FFFF; text-shadow: .1em .1em 0 #153F3F; }
.mcmotd .mcmotd-c-c { color: #FF5555; text-shadow: .1em .1em 0 #3F1515; }
.mcmotd .mcmotd-c-d { color: #FF55FF; text-shadow: .1em .1em 0 #3F153F; }
.mcmotd .mcmotd-c-e { color: #FFFF55; text-shadow: .1em .1em 0 #3F3F15; }
.mcmotd .mcmotd-c-f { color: #FFFFFF; text-shadow: .1em .1em 0 #3F3F3F; }

/* Swatch and reference chip backgrounds, with ink chosen for contrast */
.mcmotd .mcmotd-bg-0 { background: #000000; color: #fff; }
.mcmotd .mcmotd-bg-1 { background: #0000AA; color: #fff; }
.mcmotd .mcmotd-bg-2 { background: #00AA00; color: #000; }
.mcmotd .mcmotd-bg-3 { background: #00AAAA; color: #000; }
.mcmotd .mcmotd-bg-4 { background: #AA0000; color: #fff; }
.mcmotd .mcmotd-bg-5 { background: #AA00AA; color: #fff; }
.mcmotd .mcmotd-bg-6 { background: #FFAA00; color: #000; }
.mcmotd .mcmotd-bg-7 { background: #AAAAAA; color: #000; }
.mcmotd .mcmotd-bg-8 { background: #555555; color: #fff; }
.mcmotd .mcmotd-bg-9 { background: #5555FF; color: #fff; }
.mcmotd .mcmotd-bg-a { background: #55FF55; color: #000; }
.mcmotd .mcmotd-bg-b { background: #55FFFF; color: #000; }
.mcmotd .mcmotd-bg-c { background: #FF5555; color: #000; }
.mcmotd .mcmotd-bg-d { background: #FF55FF; color: #000; }
.mcmotd .mcmotd-bg-e { background: #FFFF55; color: #000; }
.mcmotd .mcmotd-bg-f { background: #FFFFFF; color: #000; }

/* Outputs */
.mcmotd .mcmotd-out { margin: 0 0 1.4rem; min-width: 0; }
.mcmotd .mcmotd-code { display: block; overflow-y: hidden; width: 100%; max-width: 100%; min-height: 3.6rem; resize: vertical; padding: .7rem .85rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .92rem; line-height: 1.45; background: var(--surface-2, var(--bg-alt)); color: var(--text); border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; word-break: break-all; white-space: pre-wrap; }
.mcmotd .mcmotd-code:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.mcmotd .mcmotd-copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: .5rem 0 .4rem; }
.mcmotd .mcmotd-copy { font-size: .95rem; padding: .55rem 1.1rem; cursor: pointer; }
.mcmotd .mcmotd-copy::after { content: none; }
.mcmotd .mcmotd-status { color: var(--good); font-weight: 700; font-size: .95rem; }
.mcmotd .mcmotd-out p { margin: 0; }

/* Reference tables */
.mcmotd table.mcmotd-ref { min-width: 0; }
.mcmotd .mcmotd-ref th, .mcmotd .mcmotd-ref td { padding: .55rem .8rem; }
.mcmotd .mcmotd-ref td:first-child, .mcmotd .mcmotd-ref td:nth-child(3), .mcmotd .mcmotd-ref td:nth-child(4) { white-space: nowrap; }
.mcmotd .mcmotd-ref td:nth-child(4) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.mcmotd .mcmotd-chip { display: inline-block; width: 1em; height: 1em; border-radius: 3px; margin-right: .45em; vertical-align: -.12em; border: 1px solid rgba(13, 20, 40, .3); }
html[data-theme="dark"] .mcmotd .mcmotd-chip { border-color: rgba(255, 255, 255, .35); }

@media (max-width: 560px) {
  .mcmotd .mcmotd-panel { padding: .9rem .8rem .2rem; }
  .mcmotd .mcmotd-swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .3rem; }
  .mcmotd .mcmotd-sw { min-height: 2.4rem; font-size: .85rem; }
  .mcmotd .mcmotd-stage { padding: .7rem; }
  .mcmotd .mcmotd-row { font-size: .85rem; min-width: 28rem; }
  .mcmotd .mcmotd-ref th, .mcmotd .mcmotd-ref td { padding: .5rem .5rem; font-size: .88rem; }
  .mcmotd .mcmotd-ref td:nth-child(3), .mcmotd .mcmotd-ref td:nth-child(4) { white-space: normal; overflow-wrap: anywhere; }
  .mcmotd .mcmotd-ref thead th { letter-spacing: .02em; }
}
@media (prefers-reduced-motion: reduce) {
  .mcmotd .mcmotd-sw:hover { transform: none; }
}
