/* The tools and the tool cards. Loaded after style.css and builds on its variables, buttons and inventory GUI
   classes (.gui, .slot, .arrow). Interface text uses the normal (readable) font; the pixel font is kept only for
   things that show the game itself: tooltips, the server list, chat, the XP bar and inventory slot counts. */

.tool-head .lead { margin-bottom: 0; }
.tool-head .crumbs ol { margin-bottom: 10px; }

/* ---------- search-style forms (Skin Finder, Server Status) */
.search { position: relative; display: flex; flex: 1 1 300px; max-width: 520px; }
.search .tool-input { flex: 1; width: auto; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.search .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: none; }
.search .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.search-lg { max-width: 640px; margin: 18px 0; }
.search-lg .tool-input { font-size: 1.05rem; padding: 13px 16px; }
.search-lg .btn { padding: 13px 22px; }
.tool-panel { padding-top: clamp(18px, 2.6vw, 28px); }
.tool-noscript { margin: 0; color: var(--yellow); }

.tool-h { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.6em; }
.tool-h:not(:first-child) { margin-top: 1.3em; }
.tool-h-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 1.3em; }
.tool-h-row .tool-h { margin: 0 0 0.4em; }
.tool-note { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.tool-empty { margin: 0; padding: 18px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.tool-warn { margin: 0 0 14px; padding: 10px 14px; color: var(--danger); font-size: 0.92rem; background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: var(--radius-sm); }
.tool-warn ul { margin: 6px 0; padding-left: 1.2em; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }

.tool-input, .tool-select {
  width: 100%; min-width: 0;
  font: 1rem var(--font-body); color: var(--text);
  background: var(--input); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tool-input:focus, .tool-select:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.tool-fields { display: grid; grid-template-columns: 1.4fr 1fr 0.6fr; gap: 12px; margin-bottom: 12px; }
.tool-fields label { display: grid; gap: 5px; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }

/* ---------- toggle buttons (items, shapes, effects, viewer controls) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 142px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.choices-row { display: flex; flex-wrap: wrap; }
.choice {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 11px; text-align: left; cursor: pointer;
  font: 600 0.9rem/1.2 var(--font-body); color: var(--text);
  background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; box-shadow: var(--bevel);
}
.choices-row .choice { width: auto; }
.choice img { width: 32px; height: 32px; flex: none; }
.choices-row .choice img { width: 28px; height: 28px; }
.choice:hover { border-color: var(--accent); background: var(--surface); }
.choice:focus-visible { outline: none; box-shadow: var(--ring); }
.choice[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-sm { padding: 6px 12px; font-size: 0.85rem; }
.choice-group + .choice-group { margin-top: 14px; }
.choice-group-h { margin: 0 0 6px; font: 700 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- enchantment glint: a purple shimmer masked to the sprite's own pixels */
.glint { position: relative; display: inline-block; line-height: 0; }
.glint::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(170, 90, 255, 0.85) 46%, rgba(255, 200, 255, 0.95) 50%, rgba(170, 90, 255, 0.85) 54%, transparent 65%) 0 0 / 300% 100%;
  -webkit-mask: var(--icon) center / 100% 100% no-repeat;
  mask: var(--icon) center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  animation: ccx-glint 2.6s linear infinite;
}
@keyframes ccx-glint { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .glint::after { animation: none; background-position: 50% 0; opacity: 0.6; } }

/* ---------- tool cards (home page and "More Minecraft Tools") */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.tool-card {
  display: flex; align-items: center; gap: 16px; height: 100%; padding: 16px 18px;
  color: var(--text); text-decoration: none;
  background: var(--card); border: 2px solid var(--edge); border-radius: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tool-card img { width: 60px; height: 60px; flex: none; padding: 10px; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.tool-card-title { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--text); }
.tool-card-desc { display: block; margin-top: 3px; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.tool-card:hover, .tool-card:focus-visible { color: var(--text); border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card:hover .tool-card-title { color: var(--accent-ink); }
.tool-card:hover img { background: var(--accent-soft); border-color: var(--accent-line); }

/* ---------- Enchanting Calculator */
.ench-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.ench-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ench-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 8px 10px 8px 14px; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel);
}
.ench-row.on { border-color: var(--accent); background: var(--ok-soft); }
.ench-name { font-weight: 600; line-height: 1.3; }
.ench-name small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.ench-row.blocked .ench-name { color: var(--muted); }
.ench-row.blocked .ench-name small { color: var(--gold); }
.ench-row.curse .ench-name { color: var(--danger); }
.lvls { display: flex; gap: 4px; }
.lvl {
  min-width: 38px; height: 32px; padding: 0 8px; cursor: pointer;
  font: 600 0.82rem/1 var(--font-body); color: var(--text-soft);
  background: var(--card); border: 2px solid var(--edge); border-radius: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease; box-shadow: var(--bevel);
}
.lvl:hover { border-color: var(--accent); background: var(--surface); }
.lvl:focus-visible { outline: none; box-shadow: var(--ring); }
.lvl[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.ench-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { padding: 12px 8px; text-align: center; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.stat strong { display: block; font: 800 1.8rem/1.1 var(--font-body); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.stat span { display: block; margin-top: 4px; font-size: 0.78rem; line-height: 1.3; color: var(--muted); }
.ench-summary.bad .stat strong { color: var(--danger); }

.anvil-steps { display: grid; gap: 18px; margin: 0 0 18px; padding: 0; list-style: none; }
.anvil-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.anvil-n { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.anvil-what { font-size: 0.9rem; color: var(--muted); }
.anvil-gui {
  --s: 54px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 14px 12px; color: var(--gui-text);
  background: var(--gui); border: 3px solid #000; border-radius: 4px;
  box-shadow: inset 4px 4px 0 var(--gui-hi), inset -4px -4px 0 var(--gui-lo);
}
.anvil-col { display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; }
.anvil-gui .plus, .anvil-gui .arrow { margin-top: calc(var(--s) / 2 - 16px); }
.anvil-gui .plus { line-height: 32px; }
.anvil-ench { display: grid; gap: 1px; font-size: 0.76rem; line-height: 1.25; color: #2e2e2e; overflow-wrap: anywhere; }
.anvil-ench.empty { color: #6b6b6b; }
.anvil-ench .curse, .mc-card-ench .curse { color: #c01818; }
.anvil-cost { display: inline-block; margin: 8px 0 0; padding: 3px 10px; font-weight: 700; font-size: 0.85rem; color: var(--accent-ink); background: var(--accent-soft); border-radius: 0; }
.anvil-cost.too { color: var(--danger); background: var(--danger-soft); }

/* The finished item, as an in-game tooltip */
.mc-card {
  display: flex; align-items: flex-start; gap: 14px; margin: 0 0 12px; padding: 12px 16px;
  background: var(--tooltip-bg); border: 2px solid #100010; border-radius: 0;
  box-shadow: inset 0 0 0 2px var(--tooltip-border);
}
.mc-card-icon { flex: none; }
.mc-card-icon img { width: 48px; height: 48px; display: block; }
.mc-card-name { display: block; font: 400 1.6rem/1.1 var(--font-pixel); color: #55ffff; text-shadow: 2px 2px 0 #153f3f; }
.mc-card-ench { display: grid; font: 400 1.3rem/1.15 var(--font-pixel); color: #aaaaaa; text-shadow: 2px 2px 0 #2a2a2a; }
.mc-card-ench .curse { color: #ff5555; text-shadow: 2px 2px 0 #3f1515; }

/* ---------- Firework Generator */
.fw-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.fw-field { margin-bottom: 14px; }
.fw-label { margin: 14px 0 6px; font: 700 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fw-field .fw-label { margin-top: 0; }
.fw-explosion { position: relative; min-width: 0; margin: 0 0 14px; padding: 8px 16px 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.fw-explosion legend { padding: 0 6px; font-weight: 700; font-size: 0.95rem; color: var(--text); }
.fw-remove { position: absolute; top: 8px; right: 14px; font-size: 0.85rem; }
.swatches { display: grid; grid-template-columns: repeat(8, 34px); gap: 6px; }
.swatch {
  position: relative; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.22); border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: transform 0.1s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch[aria-pressed="true"]::after {
  content: 'âœ“'; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 1.05rem/1 var(--font-body); color: #fff; text-shadow: 0 0 3px #000, 1px 1px 0 #000;
}
.custom-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.color-in { width: 44px; height: 36px; padding: 2px; cursor: pointer; background: var(--input); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; cursor: pointer;
  font: 0.8rem var(--font-body); color: var(--text); background: var(--card); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel);
}
.chip:hover { border-color: var(--accent); }
.chip-dot { width: 14px; height: 14px; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 50%; }
.fw-stage { position: relative; margin-bottom: 18px; border-radius: 0; overflow: hidden; box-shadow: var(--shadow); }
.fw-canvas { display: block; width: 100%; height: 300px; background: #05060f; }
.fw-stage .btn { position: absolute; right: 12px; bottom: 16px; }
.cmd {
  display: block; width: 100%; min-height: 96px; resize: vertical; padding: 11px 13px;
  font: 0.86rem/1.5 var(--font-mono); color: var(--text); word-break: break-all;
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
}
.cmd:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.cmd-status { color: var(--accent-ink); font-size: 0.9rem; font-weight: 600; }
.fw-recipe-wrap { margin-top: 10px; }
.fw-recipe .recipes { margin-top: 6px; }

/* ---------- Skin Finder */
.skin-form { margin: 0 0 8px; }
.skin-examples { margin: 0 0 6px; font-size: 0.92rem; color: var(--muted); }
.skin-status { margin: 6px 0 0; min-height: 1.6em; }
.skin-status.loading { color: var(--muted); }
.skin-status.error { color: var(--danger); }
.skin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; margin-top: 16px; align-items: start; }
.skin-name { margin: 0 0 0.25em; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text); overflow-wrap: anywhere; }
.skin-info .facts { margin: 0 0 14px; }
.skin-uuid code { font-size: 0.78rem; overflow-wrap: anywhere; }
.sk-view .sk-controls { margin-top: 12px; }
.sk-hint { margin-top: 8px; }

.sk-stage {
  position: relative; height: clamp(360px, 70vw, 470px); overflow: hidden;
  perspective: 1400px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 38%, #3d4d6e, #121624 72%);
  border-radius: 0; box-shadow: var(--shadow);
}
.sk-stage::after { /* a soft shadow under the feet */
  content: ''; position: absolute; left: 50%; bottom: 7%; width: 34%; height: 5%; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%); pointer-events: none;
}
.sk-stage.dragging { cursor: grabbing; }
.sk-stage .tool-warn { position: absolute; left: 16px; right: 16px; top: 16px; }
.sk-model { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.sk-part, .sk-part-inner, .sk-box { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.sk-face { position: absolute; left: 0; top: 0; background-repeat: no-repeat; image-rendering: pixelated; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sk-tex-skin { background-image: var(--skin); background-size: var(--skin-size) var(--skin-size); }
.sk-tex-cape { background-image: var(--cape); background-size: var(--cape-w) var(--cape-h); }
.no-over .sk-over, .no-cape .sk-cape { display: none; }

.skin-steps { margin: 16px 0; padding: 16px 20px; background: var(--ok-soft); border: 1px solid var(--accent-line); border-radius: 0; }
.skin-steps h3 { margin: 0 0 8px; color: var(--accent-ink); }
.skin-steps h3:focus { outline: none; }
.skin-steps h4 { margin: 16px 0 6px; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.skin-steps ol { margin: 0 0 8px; padding-left: 1.3em; }
.skin-steps li { margin-bottom: 4px; }
.skin-steps li::marker { color: var(--accent); font-weight: 700; }
.skin-texture { margin: 18px 0 0; }
.skin-texture img {
  display: block; width: 192px; height: 192px; border: 2px solid var(--edge); border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--surface) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; box-shadow: var(--bevel);
}
.skin-texture figcaption { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Banner Designer */
.bn-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.bn-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.bn-stage {
  display: flex; flex-direction: column; align-items: center; padding: 24px 16px 28px; margin-bottom: 14px;
  /* light enough that black and grey banners still stand out */
  background: radial-gradient(circle at 50% 40%, #8a94ad, #4b5368 80%);
  border-radius: 0; box-shadow: var(--shadow);
}
.bn-pole { /* the banner's wooden crossbar */
  width: 184px; height: 14px; margin-bottom: -2px; position: relative; z-index: 1;
  background: linear-gradient(#8a6a3e 0 30%, #6b4f2d 30% 75%, #4a361e 75%);
  border: 2px solid #000;
}
.bn-big { box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.35); }
.bn-tooltip { border-radius: 0; }
.bn-tooltip .bn-tip-name { color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.bn-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

.bn-layers { display: grid; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.bn-empty { padding: 12px 14px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-size: 0.92rem; }
.bn-layer {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel);
}
.bn-layer.over { border-color: var(--danger-line); background: var(--danger-soft); }
.bn-layer-n { font-weight: 700; font-size: 0.9rem; color: var(--muted); min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.bn-layer .bn-canvas { border: 1px solid rgba(0, 0, 0, 0.3); }
.bn-layer-name { font-weight: 600; line-height: 1.25; min-width: 0; }
.bn-layer-name small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.bn-color { width: auto; padding: 6px 8px; font-size: 0.85rem; }
.bn-layer-btns { display: flex; gap: 4px; }
.bn-move { min-width: 32px; height: 32px; font-size: 1rem; }
.bn-move:disabled { opacity: 0.35; cursor: default; }

.bn-picker.full { opacity: 0.45; pointer-events: none; }
.bn-group + .bn-group { margin-top: 12px; }
.bn-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.bn-pat {
  position: relative; display: grid; place-items: center; width: 100%; padding: 6px 0; cursor: pointer;
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease; box-shadow: var(--bevel);
}
.bn-pat:hover { background: var(--accent-soft); border-color: var(--accent); }
.bn-pat:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.bn-pat-item { position: absolute; right: 2px; bottom: 2px; line-height: 0; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4)); }
.bn-pat-item img { width: 16px; height: 16px; }

.bn-steps-wrap { margin-top: 10px; }
.bn-cards { gap: 20px; }
.bn-step { max-width: 100%; }
.bn-step-note { max-width: 330px; margin: 8px 0 0; }
.bn-need { display: block; margin-top: 4px; color: var(--gold); }
.bn-loom { --s: 58px; }
.bn-loom-in { display: flex; gap: 4px; }
.bn-loom .slot-out, .bn-step .slot-out { --s: 76px; }

/* ---------- Skin Maker */
.sm-bar { display: grid; gap: 8px; margin-bottom: 16px; padding: 10px 12px; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.sm-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sm-bar-row > .choice { width: auto; }
.sm-palette, .sm-recent { grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 5px; }
.sm-palette .swatch, .sm-recent .swatch { width: auto; height: auto; aspect-ratio: 1; border-radius: 0; }
.sm-seg { gap: 4px; }
.sm-bar .btn:disabled { opacity: 0.45; cursor: default; background: var(--card); }
.sm-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sm-stage {
  background: radial-gradient(circle at 50% 40%, #4a5878, #1a1e2c 75%);
  border-radius: 0; overflow: hidden; box-shadow: var(--shadow);
}
.sm-3d { display: block; width: 100%; height: clamp(380px, 46vw, 540px); touch-action: none; outline-offset: -3px; }
.sm-3d.turning { cursor: grabbing !important; }
.sm-turn { margin-top: 10px; }
.sm-2d-wrap { border-radius: 0; overflow: hidden; box-shadow: var(--shadow); line-height: 0; }
.sm-2d { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; touch-action: none; }
.sm-where { min-height: 2.6em; margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.sm-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin-top: 20px; }
.sm-panel { padding: 16px 18px; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.sm-panel .tool-h { font-size: 1.05rem; }
.sm-color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sm-color { width: 64px; height: 40px; }
.sm-hex { width: 110px; font-family: var(--font-mono); }
.sm-recent:empty::before { content: 'Colours you paint with appear here.'; grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.sm-label { display: block; margin: 12px 0 5px; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.sm-inline { display: flex; gap: 6px; }
.sm-inline .tool-input { flex: 1; }
.ccx-tool-skinmaker .skin-steps { margin-top: 16px; }

/* ---------- responsive */
@media (max-width: 999px) {
  .sm-layout { grid-template-columns: minmax(0, 1fr); }
  .sm-2d-wrap { max-width: 512px; }
  .ench-layout, .fw-layout, .skin-grid { grid-template-columns: minmax(0, 1fr); }
  /* One column: the banner preview moves above the designer, the give command stays below it. */
  .bn-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .bn-out { display: contents; }
  .bn-out > * { order: 1; }
  .bn-out > .bn-stage, .bn-out > .bn-tooltip { order: -1; }
  .bn-design { margin-bottom: 10px; }
}
@media (max-width: 640px) {
  /* number and thumbnail on the left; name on the first row, colour and buttons on the second */
  .bn-layer { grid-template-columns: auto auto minmax(0, 1fr) auto; row-gap: 6px; }
  .bn-layer-n, .bn-layer .bn-canvas { grid-row: span 2; }
  .bn-layer-name { grid-column: 3 / 5; }
  .bn-color { grid-column: 3; grid-row: 2; justify-self: start; }
  .bn-layer-btns { grid-column: 4; grid-row: 2; }
  .bn-loom { --s: 50px; }
  .bn-loom .slot-out, .bn-step .slot-out { --s: 66px; }
  .anvil-gui { --s: 44px; gap: 4px; padding: 10px 8px; }
  .anvil-gui .arrow { width: 26px; height: 20px; margin-top: calc(var(--s) / 2 - 10px); }
  .anvil-gui .plus { font-size: 1.5rem; line-height: 20px; margin-top: calc(var(--s) / 2 - 10px); }
  .anvil-ench { font-size: 0.7rem; }
  .stat strong { font-size: 1.5rem; }
  .tool-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tool-fields label:first-child { grid-column: 1 / -1; }
  .swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
  .swatch { width: auto; height: auto; aspect-ratio: 1; }
  .fw-canvas { height: 240px; }
  .tool-card { padding: 14px; gap: 12px; }
  .tool-card img { width: 52px; height: 52px; padding: 8px; }
}

/* ================================================================ newer tools */

/* ---------- Minecraft text (MOTD Generator, Server Status): the game's own look */
.mc-text { font: 400 1.35rem/1.15 var(--font-pixel); white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-line { display: block; min-height: 1.15em; }
.mc-serverlist {
  padding: 10px; margin: 0 0 12px;
  background: linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)), url(../img/tex/dirt.svg) 0 0 / 48px 48px;
  border-radius: 0; box-shadow: var(--shadow);
}
.mc-server { display: flex; gap: 10px; padding: 4px; border: 2px solid #808080; background: rgba(0, 0, 0, 0.55); }
.mc-server-icon { width: 64px; height: 64px; flex: none; image-rendering: pixelated; }
.mc-server-body { min-width: 0; flex: 1; }
.mc-server-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-server-name { font: 400 1.35rem/1.15 var(--font-pixel); color: #fff; text-shadow: 0.125em 0.125em 0 #3f3f3f; overflow-wrap: anywhere; }
.mc-server-players { display: inline-flex; align-items: center; gap: 6px; flex: none; color: #aaa; text-shadow: 0.125em 0.125em 0 #2a2a2a; }
.mc-server-motd { color: #aaa; }
.mc-ping { display: inline-flex; align-items: flex-end; gap: 1px; height: 16px; }
.mc-ping i { display: block; width: 3px; background: #00ff21; box-shadow: 1px 1px 0 #00570b; }
.mc-ping i:nth-child(1) { height: 4px; } .mc-ping i:nth-child(2) { height: 7px; } .mc-ping i:nth-child(3) { height: 10px; }
.mc-ping i:nth-child(4) { height: 13px; } .mc-ping i:nth-child(5) { height: 16px; }
.mc-ping.off b { font: 700 1rem/1 var(--font-body); color: #ff3b3b; }
.mc-chat { min-height: 92px; margin: 0 0 12px; padding: 10px 12px; background: #2b2b33; border-radius: 0; color: #fff; box-shadow: var(--shadow); }

/* ---------- MOTD Generator */
.motd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.motd-edit .choices-row { margin-bottom: 4px; gap: 6px; }
.motd-swatches { grid-template-columns: repeat(8, minmax(0, 34px)); }
.motd-formats .choice { width: auto; }
.motd-extra { display: grid; gap: 4px; margin: 10px 0 14px; }
.motd-check { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; color: var(--text-soft); }
.motd-input { min-height: 118px; resize: vertical; font: 0.95rem/1.6 var(--font-mono); }
.motd-presets { margin-top: 10px; }
.motd-name-field { display: grid; gap: 5px; margin-top: 12px; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.motd-meter { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.motd-meter strong { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.motd-meter .over strong { color: var(--danger); }
.motd-box { margin-bottom: 16px; }
.motd-box-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.motd-box-label { flex: 1 1 220px; font-weight: 600; font-size: 0.92rem; }
.motd-box .cmd { min-height: 64px; }
.motd-box .tool-note { margin: 5px 0 0; }

/* ---------- Server Status */
.server-form { margin-top: 12px; }
.server-result { margin-top: 16px; }
.server-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.server-head .skin-name { margin: 0; }
.server-badge { font: 700 0.78rem/1 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 11px; border-radius: 0; }
.server-badge::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.server-badge.on { color: var(--accent-ink); background: var(--accent-soft); }
.server-badge.off { color: var(--danger); background: var(--danger-soft); }
.server-facts { margin: 4px 0 16px; }
.server-players { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.server-players li { padding: 3px 11px; font-size: 0.88rem; background: var(--card); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.server-more { margin: 0 0 10px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.server-more summary { cursor: pointer; font-weight: 600; }
.server-more .server-players { margin: 10px 0 2px; }
.server-when { margin-top: 12px; }

/* ---------- XP Calculator */
.xp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.xp-side { display: grid; gap: 16px; }
.xp-card .tool-h { font-size: 1.1rem; }
.xp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.xp-field { display: grid; gap: 5px; margin-bottom: 12px; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.xp-presets { margin: 0 0 16px; gap: 6px; }
.xp-out .ench-summary { margin-bottom: 12px; }
.xp-out .stat { background: var(--card); }
.xp-eq-h { margin: 6px 0 8px; font-weight: 600; }
.xp-eq { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.xp-eq li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 12px; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.xp-eq img { width: 24px; height: 24px; }
.xp-eq strong { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.xp-eq small { color: var(--muted); }
.xp-bar-wrap { position: relative; margin: 30px 0 14px; }
.xp-level {
  position: absolute; left: 50%; top: -26px; transform: translateX(-50%);
  font: 400 1.7rem/1 var(--font-pixel); color: #80ff20;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000;
}
.xp-bar { height: 14px; background: #1b1b1b; border: 2px solid #000; border-radius: 3px; box-shadow: inset 0 2px 0 #333; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(#a2ff5e, #80ff20 45%, #4f9c14); }
.xp-table-card { margin-top: 16px; }
.xp-table-wrap { max-height: 460px; overflow: auto; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.xp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.xp-table th, .xp-table td { padding: 7px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.xp-table th:first-child, .xp-table td:first-child { text-align: left; }
.xp-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--text); font-weight: 700; font-size: 0.82rem; }
.xp-table tbody tr:hover { background: var(--surface); }
.xp-table tr.hl td { color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; }

/* ---------- Slime Chunk Finder */
.slime-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 14px 0 4px; }
.slime-form .xp-field { margin-bottom: 0; }
.slime-form .btn { padding-top: 10px; padding-bottom: 10px; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.slime-form .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.slime-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; margin-top: 16px; }
.slime-map { position: relative; border: 2px solid var(--edge); border-radius: 0; overflow: hidden; line-height: 0; box-shadow: var(--shadow-sm); }
.slime-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.slime-canvas.dragging { cursor: grabbing; }
.slime-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; line-height: 1; }
.slime-zoom .btn { min-width: 38px; height: 38px; padding: 0; font-size: 1.2rem; }
.slime-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 14px 18px; line-height: 1.45;
  background: var(--card); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--shadow); color: var(--text); text-align: center;
}
.slime-info { min-height: 1.65em; margin: 6px 0; font-size: 0.92rem; }
.slime-info .yes { color: var(--accent-ink); }
.slime-info .no { color: var(--muted); }
.slime-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.slime-key { display: inline-block; width: 14px; height: 14px; border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 3px; vertical-align: -2px; }
.slime-key-on { background: #6cc349; }
.slime-key-you { background: #ff5555; }
.slime-key-axis { background: rgba(176, 124, 0, 0.6); }
.slime-side .tool-h { font-size: 1.1rem; }
.slime-near { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.slime-near-btn {
  display: grid; width: 100%; padding: 9px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease; box-shadow: var(--bevel);
}
.slime-near-btn strong { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--text); }
.slime-near-btn small { color: var(--muted); font-size: 0.8rem; }
.slime-near-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.slime-near-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.slime-near-btn:hover strong { color: var(--accent-ink); }

/* ---------- colour code table (MOTD Generator page text) */
.code-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 3px; vertical-align: -2px; }

/* ---------- more tools (bottom of each tool page) */
.more-tools .tool-cards { margin-top: 0; }

@media (max-width: 999px) {
  .motd-layout, .xp-grid, .slime-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .slime-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .slime-form .slime-seed-field, .slime-form .btn { grid-column: 1 / -1; }
  .xp-fields { grid-template-columns: 1fr 1fr; }
  .mc-text, .mc-server-name { font-size: 1.15rem; }
  .mc-server-icon { width: 48px; height: 48px; }
  .motd-swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ================================================================ shared pieces for the tools (js/lib.js) */
.field { display: grid; gap: 5px; align-content: start; font-size: 0.84rem; font-weight: 600; color: var(--text-soft); }
.field small { font-weight: 400; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 0 0 14px; }
.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.box { padding: 16px 18px; margin: 0 0 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.box > .tool-h:first-child { margin-top: 0; }
.t-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.t-cols-wide { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 8px; margin: 0 0 14px; }
.stat.warn strong { color: var(--danger); }
.out { margin-bottom: 14px; }
.out-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.out-label { flex: 1 1 200px; font-weight: 600; font-size: 0.9rem; color: var(--heading); }
.out .tool-note { margin: 5px 0 0; }
.out .cmd { min-height: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--text-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.res-table-wrap { overflow: auto; border: 2px solid var(--edge); border-radius: var(--radius-sm); margin: 0 0 14px; box-shadow: var(--bevel); }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.res-table th, .res-table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.res-table tr:last-child td { border-bottom: 0; }
.res-table thead th { background: var(--surface); color: var(--heading); font-weight: 700; font-size: 0.8rem; position: sticky; top: 0; }
.res-table td.num, .res-table th.num { text-align: right; }
.res-table tbody tr:hover { background: var(--surface); }
.big { font: 800 clamp(1.6rem, 4vw, 2.2rem)/1.1 var(--font-body); letter-spacing: -0.02em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-end { justify-content: flex-end; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 0; font-size: 0.8rem; font-weight: 600; background: var(--surface); border: 2px solid var(--edge); box-shadow: var(--bevel); }
.pill.ok { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.pill.bad { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.drop { display: grid; place-items: center; gap: 6px; padding: 26px; text-align: center; color: var(--muted); background: var(--surface); border: 2px dashed var(--line-strong); border-radius: 0; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.canvas-frame { line-height: 0; border: 2px solid var(--edge); border-radius: 0; overflow: hidden; background: var(--surface); box-shadow: var(--bevel); }
.checker { background: repeating-conic-gradient(var(--surface) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; }
@media (max-width: 999px) { .t-cols, .t-cols-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .fields-2 { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================ widgets of the newer tools */
/* Time Converter dial */
.dial { position: relative; width: min(260px, 100%); aspect-ratio: 1; margin: 6px auto; border-radius: 50%;
  background: conic-gradient(#8fd0ff 0deg, #8fd0ff 60deg, #f6a04d 90deg, #1a2340 125deg, #1a2340 235deg, #f6a04d 270deg, #8fd0ff 300deg);
  border: 2px solid var(--edge); box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.12); }
.dial::after { content: ''; position: absolute; inset: 38%; border-radius: 50%; background: var(--block); border: 2px solid var(--edge); box-shadow: var(--bevel); }
.dial-hand { position: absolute; left: calc(50% - 2px); top: 8%; width: 4px; height: 42%; border-radius: 2px; background: var(--heading); transform-origin: 50% 100%; z-index: 1; transition: transform 0.2s ease; }
.dial-sun, .dial-moon { position: absolute; left: 50%; transform: translateX(-50%); font-size: 1.3rem; z-index: 1; }
.dial-sun { top: 4px; color: #ffd86b; } .dial-moon { bottom: 4px; color: #dfe7ff; }
/* Username Generator */
.name-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.name-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.name-text { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; color: var(--heading); background: none; border: 0; overflow-wrap: anywhere; }
/* Player Head / Server Icon */
.head-canvas { width: 96px; height: 96px; image-rendering: pixelated; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.icon-big { display: block; width: 256px; height: 256px; image-rendering: pixelated; cursor: grab; touch-action: none; }
.drop .icon { width: 28px; height: 28px; color: var(--accent-ink); }
/* Colour Codes */
.code-copy { padding: 2px 8px; font: 600 0.88rem var(--font-mono); color: var(--heading); background: var(--surface); border: 2px solid var(--edge); border-radius: 0; cursor: pointer; box-shadow: var(--bevel); }
.code-copy:hover { border-color: var(--accent); }
.code-copy.done { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.code-preview-cell { background: #24262b; }
[data-theme="light"] .code-preview-cell { background: #3a3d44; }
.code-preview { font-size: 1.4rem; }
/* Enchanting Table Translator */
.rune-out { font-size: 1.3rem; line-height: 1.5; }
.rune-chart { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.rune-cell { display: grid; place-items: center; gap: 2px; width: 100%; padding: 10px 4px; cursor: pointer; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.rune-cell:hover { border-color: var(--accent); }
.rune-glyph { font-size: 1.5rem; line-height: 1.2; color: var(--heading); }
.rune-letter { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
/* Click Speed Test */
.cps-area { display: grid; place-items: center; align-content: center; gap: 6px; width: 100%; min-height: 260px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  color: var(--heading); background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius); font: inherit; }
.cps-area:hover { border-color: var(--accent); }
.cps-area.running { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.cps-area.done { border-style: solid; }
.cps-big { font: 800 clamp(2rem, 6vw, 3.4rem)/1 var(--font-body); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cps-sub { color: var(--muted); }
.cps-bar { height: 6px; margin: 10px 0 14px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.cps-fill { height: 100%; width: 0; background: var(--accent); }
/* Gradient Text */
.grad-stops { gap: 10px; }
.grad-stop { display: inline-flex; align-items: center; gap: 4px; }
.grad-preview { font-size: 1.6rem; }
.grad-preview .mc-text, .grad-preview { font-family: var(--font-pixel); }
/* Armour Dye Mixer */
.dye-swatch { display: inline-block; width: 46px; height: 46px; border-radius: 0; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.dye-target { width: 60px; height: 40px; }
.dye-recipe { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.dye-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; font-weight: 700; background: var(--card); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.dye-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dye-cell { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.dye-cell img { width: 32px; height: 32px; }
.dye-n { min-width: 1.4em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Advancement Maker */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-bottom: 8px; }
.icon-pick { display: grid; place-items: center; height: 44px; padding: 0; cursor: pointer; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.icon-pick:hover { border-color: var(--accent); }
.icon-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.adv-stage { display: grid; place-items: center; padding: 28px 12px; margin-top: 12px; overflow: auto; border-radius: 0; background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url(../img/tex/dirt.svg) 0 0 / 48px 48px; }
.adv-canvas { max-width: 100%; height: auto; image-rendering: pixelated; }
/* Cape Editor and Armor Stand previews */
.cape-view { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.cape-prev, .pose-canvas { display: block; image-rendering: pixelated; background: var(--surface); border: 2px solid var(--edge); border-radius: 0; max-width: 100%; height: auto; box-shadow: var(--bevel); }
.cape-fig { margin: 0; text-align: center; }
.cape-fig figcaption { margin-top: 4px; font-size: 0.82rem; color: var(--muted); }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.pose-box { margin: 0; padding: 12px 14px; }
.pose-box h3 { font-size: 0.95rem; margin-bottom: 6px; }
.pose-row { display: grid; grid-template-columns: 18px 1fr 48px; align-items: center; gap: 8px; font-size: 0.85rem; }
.pose-row input { width: 100%; accent-color: var(--accent); }
.pose-axis { font-weight: 700; color: var(--muted); }
.pose-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-soft); }
/* Circle & Sphere */
.circle-layout { display: grid; grid-template-columns: auto minmax(150px, 220px); gap: 18px; align-items: start; }
.circle-frame { overflow: auto; max-width: 100%; justify-self: start; }
.circle-canvas { display: block; image-rendering: pixelated; }
.circle-rows { max-height: 560px; overflow: auto; margin: 0; padding: 6px 10px 6px 34px; font-size: 0.85rem; font-variant-numeric: tabular-nums; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
input[type="range"] { accent-color: var(--accent); }
/* Give / Tellraw / Book / Villager / Summon */
.ench-edit { display: grid; gap: 6px; margin-bottom: 8px; }
.ench-edit-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.ench-edit-row .tool-select { flex: 1 1 180px; width: auto; }
.ench-edit-row .tool-input { width: 90px; }
.ench-edit-row .field { flex: 0 1 140px; }
.give-name { display: block; font-size: 1.5rem; }
.give-lore { display: block; font-size: 1.3rem; }
.seg-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.seg-row { margin: 0; padding: 10px 12px; display: grid; gap: 8px; }
.seg-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg-line > .tool-input { flex: 1 1 180px; width: auto; }
.seg-line > .tool-select { flex: 0 1 190px; width: auto; }
.seg-fmts .choice { min-width: 34px; justify-content: center; }
.tellraw-preview { font-size: 1.4rem; }
.tellraw-title, .tellraw-subtitle { display: grid; place-items: center; min-height: 140px; text-align: center; font-size: 2.6rem; background: linear-gradient(#2b4a6b, #1d2b3a); }
.tellraw-subtitle { font-size: 1.6rem; }
.tellraw-actionbar { display: grid; place-items: end center; min-height: 110px; padding-bottom: 14px; font-size: 1.3rem; background: linear-gradient(#2b4a6b, #1d2b3a); }
.book { padding: 18px; background: #6b4a2b; border-radius: 0; box-shadow: var(--shadow); }
.book-page { min-height: 380px; padding: 22px 20px; font-size: 1.35rem; line-height: 1.2; color: #000; background: #f4e8c8; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.book-page span { text-shadow: none !important; }
.book-text { font-family: var(--font-mono); font-size: 0.92rem; }
.book-over { color: var(--danger); font-weight: 600; }
.trade-row { padding: 12px 14px; }
/* Potions / Trims / Enchantments */
.potion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.potion { margin: 0; }
.potion .res-table-wrap { margin: 0; }
.potion-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.potion-path { margin: 8px 0 4px; }
.trim-mats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.trim-mat { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
/* server.properties */
.props-load summary { cursor: pointer; font-weight: 700; color: var(--heading); }
.props-load textarea { margin-top: 10px; font-family: var(--font-mono); font-size: 0.85rem; }
.prop-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px); gap: 6px 16px; align-items: center; padding: 9px 10px; margin: 0 -10px; border-radius: 0; }
.prop-row + .prop-row { border-top: 1px solid var(--line); }
.prop-row.changed { background: var(--accent-soft); border-top-color: transparent; }
.prop-key { font-weight: 700; color: var(--heading); background: none; border: 0; }
.prop-desc { display: block; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 640px) {
  .circle-layout { grid-template-columns: minmax(0, 1fr); }
  .prop-row { grid-template-columns: minmax(0, 1fr); }
}
.cape-palette { display: flex; flex-wrap: wrap; gap: 5px; }
.cape-palette .swatch { width: 28px; height: 28px; }
.book-nav { gap: 6px; margin-bottom: 10px; }
.book-nav .choice { min-width: 38px; justify-content: center; }
/* Armor Trim Designer */
.td-stage { display: grid; place-items: center; padding: 16px 10px 8px; margin-bottom: 12px; border-radius: 0;
  background: radial-gradient(circle at 50% 35%, #3d4d6e, #121624 75%); box-shadow: var(--shadow); }
.td-canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.td-armor { gap: 6px; margin-bottom: 6px; }
.td-dye { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 0.9rem; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.td-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.td-pattern { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; cursor: pointer; font: 600 0.75rem var(--font-body); color: var(--text-soft);
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--bevel); }
.td-pattern:hover { border-color: var(--accent); color: var(--heading); }
.td-pattern[aria-pressed="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.td-thumb { width: 32px; height: 48px; image-rendering: pixelated; }
.td-materials { display: flex; flex-wrap: wrap; gap: 6px; }
.td-mat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; cursor: pointer; font: 600 0.82rem var(--font-body); color: var(--text-soft);
  background: var(--surface); border: 2px solid var(--edge); border-radius: 0; box-shadow: var(--bevel); }
.td-mat:hover { border-color: var(--accent); }
.td-mat[aria-pressed="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.td-mat-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.35); }
.td-off { opacity: 0.4; pointer-events: none; }
.td-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 0.9rem; color: var(--text-soft); }
