/* Minecraft MOTD Generator (motd-generator.html). Loaded after tools.css. The server list mock stays dark in both themes; every shape is our own CSS. */

.mg-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.mg-bar .tf { flex: 1 1 200px; margin: 0; }
.mg-bar .tbtn { min-height: 40px; }
.mg-start { margin-bottom: clamp(16px, 2.5vw, 32px); }
.tgrid.mg-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
@media (max-width: 900px) {
  /* one column: preview first, then the editor, then the exports */
  .tgrid.mg-grid { grid-template-columns: minmax(0, 1fr); }
  .tgrid.mg-grid > .tstack { display: contents; }
  .mg-card-pv { order: 1; } .mg-card-ed { order: 2; } .mg-card-pl { order: 3; } .mg-card-ic { order: 4; } .mg-card-out { order: 5; }
}
.mg-sub { margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--rule-paper); font-size: 0.95rem; font-weight: 800; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mg-sub small { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--on-paper-soft); }

/* MOTD list */
.mg-motds { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.mg-motd-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-motds .chip { font-family: var(--mono); font-size: 0.8rem; }

/* toolbar */
.mg-tools { margin: 16px 0 14px; padding: 10px; background: var(--paper-2); }
.mg-swatches { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.mg-sw { aspect-ratio: 1; min-height: 22px; padding: 0; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.mg-sw:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.5); }
.mg-sw:focus-visible, .mg-tools .tbtn:focus-visible { outline: 2px solid var(--red-400); outline-offset: 1px; }
.mg-toolrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mg-toolrow .tbtn { padding: 6px 9px; min-width: 34px; }
.mg-tools .tbtn.plain { background: var(--white); box-shadow: 0 0 0 1px var(--rule-paper); }
.mg-tools .tbtn.plain:hover { background: var(--rule-paper); }
@media (prefers-color-scheme: dark) { .mg-tools .tbtn.plain { background: #2a2223; } }
.tool .mg-toolrow input[type="color"] { width: 38px; height: 32px; }
.mg-sep { width: 1px; height: 24px; background: var(--rule-paper); margin: 0 2px; }
@media (max-width: 520px) { .mg-swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); } .mg-sep { display: none; } }

/* line inputs */
.mg-line { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; }
.mg-line .tf { flex: 1 1 auto; margin: 0; }
.mg-line .tbtn { flex: none; min-height: 40px; }
.mg-line small.over { color: var(--red-500); font-weight: 700; }
.mg-ph { margin-top: 12px; }
.mg-ph .chip { font-family: var(--mono); font-size: 0.76rem; padding: 4px 8px; }
#presets .chip { font-size: 0.78rem; }

/* checkboxes */
.mg-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.mg-check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.mg-check input { width: 17px; height: 17px; accent-color: var(--red-500); margin: 0; }
.mg-names { margin-top: 14px; }
.tool input.bad { outline: 2px solid var(--red-500); outline-offset: -1px; }

/* icon maker */
.mg-icon { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 14px; }
.mg-icon-pv { display: flex; align-items: end; gap: 10px; flex: none; }
.mg-icon-pv canvas { display: block; background-color: #2b2b2b; background-image: linear-gradient(45deg, #3a3a3a 25%, transparent 25%, transparent 75%, #3a3a3a 75%), linear-gradient(45deg, #3a3a3a 25%, transparent 25%, transparent 75%, #3a3a3a 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; box-shadow: 0 0 0 1px var(--rule-paper); }
#icon-big { width: 128px; height: 128px; image-rendering: pixelated; }
#icon-big.round, .mg-ico.round img { border-radius: 22%; }
.mg-icon-ctl { flex: 1 1 200px; min-width: 0; }
.mg-icon-ctl .thint { margin-top: 6px; }
.mg-bgrow { align-items: center; }
.mg-iconname { margin-top: 14px; }

/* preview */
.mg-pvbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.mg-pvbar .seg button { padding: 6px 10px; font-size: 0.8rem; }
.mg-pvbar > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-scroll { overflow-x: auto; overflow-y: hidden; background: #141010; }
.mg-list {
  --u: 2px;
  width: max-content;
  min-width: 100%;
  padding: calc(var(--u) * 8) calc(var(--u) * 4);
  background-color: #1d1716;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 calc(var(--u) * 2), transparent calc(var(--u) * 2) calc(var(--u) * 4)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 calc(var(--u) * 2), transparent calc(var(--u) * 2) calc(var(--u) * 5));
  color: #fff;
}
.mg-row {
  position: relative;
  display: flex;
  width: calc(var(--u) * 309);
  height: calc(var(--u) * 36);
  margin: 0 auto;
  padding: calc(var(--u) * 2);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 var(--u) #a0a0a0;
}
.mg-ico { position: relative; flex: none; width: calc(var(--u) * 32); height: calc(var(--u) * 32); }
.mg-ico img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.mg-ico.smooth img { image-rendering: auto; }
.mg-txt { position: relative; flex: none; width: calc(var(--u) * 270); margin-left: calc(var(--u) * 3); font-family: var(--sans); font-size: calc(var(--u) * 8.6); line-height: calc(var(--u) * 9); font-weight: 600; }
.mg-top { display: flex; justify-content: space-between; align-items: flex-start; height: calc(var(--u) * 11); padding-top: calc(var(--u) * 1); }
.mg-name { white-space: pre; color: #fff; text-shadow: var(--u) var(--u) 0 #3f3f3f; overflow: hidden; }
.mg-status { display: inline-flex; align-items: flex-start; gap: calc(var(--u) * 2); flex: none; }
.mg-count { color: #aaaaaa; text-shadow: var(--u) var(--u) 0 #2a2a2a; cursor: default; outline: none; }
.mg-count:focus-visible { box-shadow: 0 0 0 1px #fff; }
.mg-count .sl { color: #555555; text-shadow: var(--u) var(--u) 0 #151515; }
.mg-bars { display: inline-flex; align-items: flex-end; gap: calc(var(--u) * 1); height: calc(var(--u) * 7); margin-top: calc(var(--u) * 0.5); }
.mg-bars i { display: block; width: calc(var(--u) * 1.4); background: #3a3a3a; box-shadow: var(--u) var(--u) 0 #111; }
.mg-bars i:nth-child(1) { height: 20%; } .mg-bars i:nth-child(2) { height: 40%; } .mg-bars i:nth-child(3) { height: 60%; } .mg-bars i:nth-child(4) { height: 80%; } .mg-bars i:nth-child(5) { height: 100%; }
.mg-bars i.on { background: #4ee05a; }
.mg-bars.slow i.on { background: #e0c04e; }
.mg-bars.bad i.on { background: #e05a4e; }
.mg-lines { position: relative; }
.mg-l { height: calc(var(--u) * 9); white-space: pre; }
.mg-l.cut { position: absolute; left: 0; width: 100%; opacity: 0.38; }
.mg-l.cut::after { content: "hidden in game"; position: absolute; right: calc(var(--u) * -2); top: calc(var(--u) * 1); padding: 0 calc(var(--u) * 2); font-family: var(--sans); font-size: calc(var(--u) * 5); line-height: calc(var(--u) * 7); color: #fff; background: #8a0a0d; text-shadow: none; opacity: 1; }
.mg-l span { text-shadow: var(--u) var(--u) 0 #202020; }
.mg-l .ch { display: inline-block; text-align: center; overflow: visible; }
.mg-l .b { font-weight: 800; }
.mg-l .i { font-style: italic; }
.mg-l .u { text-decoration: underline; }
.mg-l .s { text-decoration: line-through; }
.mg-l .u.s { text-decoration: underline line-through; }
.mg-edge { position: absolute; top: calc(var(--u) * 11); bottom: calc(var(--u) * -2); left: calc(var(--u) * 270); width: 0; border-left: calc(var(--u) * 0.5) dashed #ff5c5c; pointer-events: none; }
.mg-edge::after { content: "edge"; position: absolute; left: calc(var(--u) * 1); bottom: calc(var(--u) * -1); font-family: var(--sans); font-size: calc(var(--u) * 4.5); color: #ff8a8a; }
.mg-list.noguide .mg-edge, .mg-list.noguide .mg-l.cut::after { display: none; }
.mg-hover { position: absolute; z-index: 5; right: calc(var(--u) * -4); top: calc(var(--u) * 12); min-width: calc(var(--u) * 60); padding: calc(var(--u) * 3) calc(var(--u) * 4); background: #100010; box-shadow: inset 0 0 0 var(--u) #2a0e5c; color: #aaaaaa; font-family: var(--mono); font-size: calc(var(--u) * 8); line-height: calc(var(--u) * 10); white-space: pre; text-shadow: var(--u) var(--u) 0 #2a2a2a; }
.mg-hover[hidden] { display: none; }
.mg-list.hovering { padding-bottom: calc(var(--u) * 132); }
#warn { margin-top: 10px; }
#warn .note + .note { margin-top: 6px; }

/* exports */
.mg-where { margin: 6px 0 14px; font-size: 0.84rem; line-height: 1.45; color: var(--on-paper-soft); }
.mg-where code { font-family: var(--mono); font-size: 0.86em; padding: 1px 4px; background: var(--rule-paper); }
.mg-where:last-child { margin-bottom: 0; }
.mg-where.warn { color: var(--on-paper); box-shadow: inset 3px 0 0 #c98a00; padding-left: 10px; }
.out-head .tbtn + .tbtn { margin-left: 6px; }
.mg-import { margin-top: clamp(16px, 2.5vw, 32px); }
.mg-import .tf > span { display: block; }
#imp-msg { margin-top: 12px; }
#imp-msg:empty { display: none; }
