/* The server editor's own styles. The site's style.css does the rest:
   colours, type, the header, .btn, .note, tables.

   Type stays at the site's 17px or larger and click targets stay big — this
   is a page people use on a second monitor while the server is running. */

/* Several things here are hidden with the hidden attribute, and a class that
   sets display (.btn is inline-flex, .ed-tabs is flex) would otherwise beat
   the browser's own [hidden] rule and show them anyway. */
[hidden]{display:none !important}

/* ---------- a smaller button, for dense rows ---------- */
.btn.sm{font-size:16px;padding:10px 18px;letter-spacing:.4px}
.btn.sm:focus-visible{outline:3px solid var(--ember);outline-offset:3px}
.btn.tiny{font-size:14px;padding:7px 13px}

/* ---------- the switches ----------
   Every true/false setting is one of these: a blocky lever you can read from
   across the room. No rounded corners anywhere — it should look like it came
   out of the game. The word beside it says ON or OFF, so the colour is never
   the only thing carrying the answer. */
.mc-sw{display:inline-flex;align-items:center;gap:12px;cursor:pointer;user-select:none;flex:none}
.mc-sw input{position:absolute;width:1px;height:1px;opacity:0;margin:0}
.mc-sw .track{position:relative;width:74px;height:36px;flex:none;background:#211f23;
  box-shadow:inset 3px 3px 0 rgba(0,0,0,.85),inset -3px -3px 0 rgba(255,255,255,.07)}
.mc-sw .knob{position:absolute;top:4px;left:4px;width:28px;height:28px;background:#5c5a60;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.3),inset -3px -3px 0 rgba(0,0,0,.55)}
.mc-sw .word{font-family:var(--display);font-size:17px;letter-spacing:.8px;color:var(--ash);
  min-width:3.6ch}
/* on: redstone-lamp green, and the knob slides to the far end */
.mc-sw input:checked + .track{background:#1f3313;
  box-shadow:inset 3px 3px 0 rgba(0,0,0,.8),inset -3px -3px 0 rgba(140,200,90,.18)}
.mc-sw input:checked + .track .knob{left:42px;background:var(--grass);
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.4),inset -3px -3px 0 rgba(0,0,0,.45)}
.mc-sw input:checked ~ .word{color:#b5e48c}
.mc-sw input:focus-visible + .track{outline:3px solid var(--ember);outline-offset:3px}
.mc-sw:hover .knob{filter:brightness(1.15)}
.mc-sw.off-is-bad input:not(:checked) + .track .knob{background:#7a4440}
/* a switch the server owns, that this one bot is overriding */
.mc-sw.disabled{cursor:not-allowed;opacity:.5}
@media (prefers-reduced-motion:no-preference){
  .mc-sw .knob{transition:left .14s steps(4,end),background .14s}
}

/* ---------- the connection strip and tabs ----------
   Both stick together, as one block, so nothing scrolls out from under them. */
.ed-sticky{position:sticky;top:68px;z-index:30;background:var(--void)}
.ed-strip .strip-in{padding-top:11px;padding-bottom:11px;gap:14px}
.ed-pill{font-family:var(--display);font-size:16px;letter-spacing:.5px;padding:6px 16px;
  border:2px solid #2a272b;border-radius:999px;white-space:nowrap;flex:none}
.ed-pill.ok{border-color:var(--grass);color:#b5e48c}
.ed-pill.bad{border-color:var(--ember);color:#ff9a92}
.ed-pill.wait{border-color:var(--gold);color:var(--gold)}
.ed-server{color:var(--ash);font-size:15px;flex:1 1 300px;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-ends{color:var(--ash);font-size:15px;flex:none;white-space:nowrap}
.ed-strip .btn{flex:none}

/* ---------- tabs ---------- */
.ed-tabs{display:flex;gap:8px;flex-wrap:wrap;padding-top:14px;padding-bottom:14px}
.ed-main{padding:26px 0 140px}

/* ---------- cards ---------- */
.ed-card{background:var(--pit);border:3px solid #000;padding:clamp(20px,3vw,28px);margin:0 0 20px}
.ed-card h2{font-size:clamp(22px,3vw,28px);color:#fff;margin-bottom:12px}
.ed-card .lede{margin-bottom:16px}
.ed-card .lede:last-child,.ed-card .note:last-child{margin-bottom:0}
.ed-card code,.ed-steps code{background:#000;padding:1px 6px;color:var(--gold)}
.ed-steps{color:var(--ash);font-size:17px;padding-left:24px;margin:0 0 16px}
.ed-steps li{margin:0 0 8px}

.ed-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:0 0 4px}
.ed-row .ed-input{flex:1;min-width:180px;width:auto}
.ed-row .btn{flex:none}
.ed-lab{font-family:var(--display);font-size:16px;color:#fff;flex:none}
.ed-find{margin-bottom:20px}
.ed-head2{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 16px}
.ed-head2 h2{font-size:clamp(22px,3vw,28px);color:#fff}
.ed-count{color:var(--ash);font-size:15.5px}
.ed-state{font-size:17px;color:#fff}
.ed-check{display:flex;align-items:center;gap:10px;color:var(--iron);font-size:16px;cursor:pointer}
.ed-check input{width:20px;height:20px;accent-color:var(--blood)}

/* a sub-heading inside a card */
.ed-sub{font-family:var(--display);font-size:19px;color:#fff;margin:26px 0 10px}
.ed-card .ed-sub:first-of-type{margin-top:18px}
.btn.danger{background:#7a1a1a}
.btn.danger:hover{background:var(--blood)}

/* ---------- one switch and what it does ---------- */
.ed-switch{display:flex;align-items:center;gap:20px;justify-content:space-between;
  padding:16px 0;border-top:2px solid #000}
.ed-switch:first-child{border-top:0}
.ed-switch .name{font-family:var(--display);font-size:18px;color:#fff}
.ed-switch .what{color:var(--ash);font-size:15.5px;max-width:60ch;margin-top:2px}
.ed-switch > div:first-child{min-width:0}
.ed-switch .btn.tiny{margin-top:8px}
/* this bot is doing its own thing, not following config.yml */
.ed-switch.own{background:#14120f;padding-left:14px;padding-right:14px;
  box-shadow:inset 4px 0 0 var(--gold)}
@media(max-width:560px){
  .ed-switch{flex-direction:column;align-items:flex-start;gap:12px}
}

/* ---------- settings ---------- */
.ed-sec{background:var(--pit);border:3px solid #000;margin:0 0 14px}
.ed-sec>summary{cursor:pointer;padding:18px 20px;font-family:var(--display);font-size:20px;color:#fff;
  list-style:none;display:flex;align-items:center;gap:14px}
.ed-sec>summary::-webkit-details-marker{display:none}
.ed-sec>summary::before{content:"+";color:var(--blood);font-size:22px;width:14px;flex:none}
.ed-sec[open]>summary::before{content:"\2013"}
.ed-sec>.body{padding:0 20px 18px}
.ed-sechelp{color:var(--ash);font-size:15.5px;white-space:pre-wrap;margin:0 0 10px}

.setting{display:grid;grid-template-columns:minmax(220px,1fr) minmax(190px,330px);
  gap:8px 24px;padding:16px 0;border-top:2px solid #000}
.setting:first-of-type{border-top:0}
.setting .name{font-family:var(--display);font-size:17.5px;color:#fff}
.setting .key{color:var(--ash);font-size:14.5px;word-break:break-all}
.setting .help{grid-column:1/-1;color:var(--ash);font-size:15.5px;white-space:pre-wrap;margin:0}
.setting .ed-input{width:100%}
.setting input[type=checkbox]{width:26px;height:26px;accent-color:var(--blood);margin:4px 0}
.setting.changed{background:#14120f}
.setting.changed .name::after{content:" \2022 changed";color:var(--gold);font-family:var(--body);font-size:14px}
.setting.bad{background:#19100f}
.setting.bad .why{grid-column:1/-1;color:#ff9a92;font-size:15.5px;margin:0}
.setting input:disabled,.setting select:disabled,.setting textarea:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:620px){.setting{grid-template-columns:1fr}}

.ed-savebar{position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--stone);
  border-top:3px solid #000;box-shadow:0 -4px 0 rgba(0,0,0,.4)}
.ed-savebar .strip-in{padding-top:14px;padding-bottom:14px;gap:16px}
.ed-savebar span{font-family:var(--display);font-size:18px;color:var(--gold)}
.ed-savebar .btn{margin-left:0}
.ed-savebar .btn:first-of-type{margin-left:auto}

/* ---------- bots ---------- */
.ed-bots{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.ed-bot{background:var(--pit);border:3px solid #000;padding:16px;
  display:grid;grid-template-columns:56px 1fr;gap:4px 16px;align-content:start}
/* a bot's face, cut straight out of its skin image - no canvas needed */
.ed-face{width:56px;height:56px;background:#2a272b;grid-row:span 3;image-rendering:pixelated;
  background-size:800% auto;background-position:-56px -56px}
/* the same trick at list size: 8x the box, offset by one box */
.ed-face.sm{width:36px;height:36px;grid-row:auto;flex:none;
  background-size:800% auto;background-position:-36px -36px}
.ed-bot .nm{font-family:var(--display);font-size:19px;color:#fff;word-break:break-all}
.ed-bot .nm small{font-family:var(--body);font-size:14px;color:var(--ash);letter-spacing:0}
.ed-hp{height:12px;background:#2b0f0e;border:2px solid #000;margin:2px 0}
.ed-hp>i{display:block;height:100%;background:var(--ember)}
.ed-bot .what{color:var(--ash);font-size:15px;line-height:1.5}
.ed-bot .acts{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap;margin-top:12px;align-items:center}
.ed-bot .acts .ed-input{flex:none;width:auto;min-width:150px}

/* ---------- lists you pick from ----------
   The groups, routes, kits and saves screens are built out of these: a short
   list of rows, one of which you click to open its own screen. */
.ed-rows{display:grid;gap:3px;background:#000;border:3px solid #000;margin:0 0 6px}
/* a line under a list, with the button that acts on what it says */
.ed-hint{display:flex;flex-wrap:wrap;align-items:center;gap:12px;color:var(--gold);
  font-size:16.5px;margin:10px 0 0}
.ed-empty{background:var(--pit);padding:18px 18px;color:var(--ash);font-size:16px}

.ed-pickrow{display:flex;align-items:center;gap:18px;width:100%;text-align:left;
  background:var(--pit);color:inherit;border:0;padding:16px 18px;cursor:pointer;
  font:inherit;transition:background .12s}
.ed-pickrow:hover{background:#1b1a1f}
.ed-pickrow:focus-visible{outline:3px solid var(--ember);outline-offset:-3px}
.ed-pickrow .nm{font-family:var(--display);font-size:19px;color:#fff}
.ed-pickrow .sub{color:var(--ash);font-size:15.5px;margin-left:auto;text-align:right;flex:none}
.ed-pickrow::after{content:"\203A";color:var(--blood);font-size:24px;line-height:1;flex:none}

/* a bot (or target) inside one of those screens, with its head and one button */
.ed-memrow{display:flex;align-items:center;gap:16px;background:var(--pit);padding:12px 18px}
.ed-memrow .nm{font-family:var(--display);font-size:18px;color:#fff;min-width:0}
.ed-memrow .sub{font-family:var(--body);font-size:14.5px;color:var(--ash);
  letter-spacing:0;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ed-memrow .btn{margin-left:auto;flex:none}
/* a patrol target that is not on the server at the moment */
.ed-memrow.gone{box-shadow:inset 4px 0 0 var(--gold)}
.ed-memrow.gone .ed-face{opacity:.4}
.ed-memrow.gone .sub{color:var(--gold)}

.ed-danger{margin-top:30px;padding-top:20px;border-top:2px solid #000}

/* ---------- tables ---------- */
.ed-table{width:100%;border-collapse:collapse;margin:8px 0 0;font-size:16px}
.ed-table th,.ed-table td{text-align:left;padding:12px 10px;border-top:2px solid #000;vertical-align:middle}
.ed-table th{color:var(--ash);font-weight:400;font-size:14.5px;text-transform:uppercase;letter-spacing:.6px}
.ed-table tr:first-child td{border-top:0}
.ed-table b{color:#fff;font-weight:500}
.ed-table .muted{color:var(--ash);font-size:15px}
.ed-table .acts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
@media(max-width:620px){
  .ed-table th{display:none}
  .ed-table td{display:block;border-top:0;padding:4px 0}
  .ed-table tr{display:block;border-top:2px solid #000;padding:12px 0}
  .ed-table .acts{justify-content:flex-start;margin-top:8px}
}

/* ---------- the log viewer ---------- */
.ed-log{background:#000;border:3px solid #000;padding:14px 16px;margin:0;
  max-height:62vh;overflow:auto;white-space:pre;font-size:14px;line-height:1.5;color:#cfcdce}
.ed-log:focus-visible{outline:3px solid var(--ember);outline-offset:2px}

/* ---------- toast ---------- */
.ed-toast{position:fixed;right:18px;bottom:96px;z-index:60;max-width:min(540px,calc(100vw - 36px));
  background:var(--stone);border:3px solid #000;border-left:4px solid var(--grass);
  padding:14px 18px;font-size:16px;line-height:1.5;box-shadow:0 6px 0 rgba(0,0,0,.45)}
.ed-toast.err{border-left-color:var(--ember)}

/* on a phone the header block would eat the screen, so let it scroll away */
@media(max-width:860px){
  .ed-sticky{position:static}
  .ed-server{white-space:normal;flex:1 1 100%}
}

/* a whole group, where a bot would have its head */
.ed-face.tile{display:flex;align-items:center;justify-content:center;background:var(--stone);
  font-family:var(--display);font-size:20px;color:var(--iron);
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.1),inset -2px -2px 0 rgba(0,0,0,.8)}

/* the opening card, while it is still looking for the server */
.ed-starting{display:flex;align-items:center;gap:16px;margin:0 0 12px}
.ed-starting h2{margin:0}
.ed-pill{display:inline-flex;align-items:center;gap:9px}
.ed-pill .sword{width:18px;height:18px}

/* a row that is only there to be read, not opened */
.ed-memrow.read{justify-content:space-between}
.ed-memrow.read .sub{font-family:var(--body);font-size:14.5px;color:var(--ash);
  letter-spacing:0;margin-top:3px}
.ed-memrow.read > .sub{margin-top:0;flex:none}

/* ---------- waiting for something ---------- */
.ed-busy{display:flex;align-items:center;gap:12px;background:var(--pit);
  padding:18px;color:var(--ash);font-size:16px}
.ed-table .ed-busy{background:none;padding:10px 0}
/* a face waiting on Mojang for its skin */
.ed-face{display:flex;align-items:center;justify-content:center}
.sword.waiting{width:70%;height:70%;opacity:.45}
.ed-face.big{width:96px;height:96px;grid-row:auto;flex:none;
  background-size:800% auto;background-position:-96px -96px}

/* ---------- looking at what you picked, before it is sent ---------- */
.ed-preview{display:flex;align-items:center;gap:22px;flex-wrap:wrap;
  background:var(--pit);border:3px solid #000;padding:18px;margin-top:14px}
.ed-skinwhole{width:192px;height:auto;image-rendering:pixelated;
  background:#000;box-shadow:inset 2px 2px 0 rgba(255,255,255,.08)}
.ed-previnfo{min-width:200px}
.ed-previnfo .name{font-family:var(--display);font-size:18px;color:#fff;word-break:break-all}
.ed-previnfo .sub{color:var(--ash);font-size:15.5px;margin-top:4px}
.ed-previnfo .sub.good{color:#b5e48c}
.ed-previnfo .sub.bad{color:#ff9a92}
.ed-bad{color:#ff9a92;font-size:16px}
.ed-audio{width:320px;max-width:100%;filter:invert(1) hue-rotate(180deg)}
.small-note{font-size:15.5px;color:#7e7b82;border-left:3px solid var(--line,#2a272b);
  padding-left:14px;margin-top:14px}

/* ---------- one link, many servers ----------
   The picker sits above everything, and the chosen server's editor fills the
   page below it. Buttons are deliberately big: this is the thing you reach
   for most on a network. */
.ed-network{background:var(--pit);border-bottom:3px solid #000;padding:22px 0 20px}
.ed-network h2{font-size:clamp(21px,3vw,26px);color:#fff;margin:0 0 14px}
.ed-servers{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.ed-srv{display:flex;flex-direction:column;align-items:flex-start;gap:5px;
  background:var(--stone);color:var(--iron);border:0;cursor:pointer;
  padding:16px 20px;text-align:left;font:inherit;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.1),inset -3px -3px 0 rgba(0,0,0,.65);
  transition:background .12s}
.ed-srv:hover{background:#2a272c;color:#fff}
.ed-srv:focus-visible{outline:3px solid var(--ember);outline-offset:3px}
.ed-srv .nm{font-family:var(--display);font-size:21px;letter-spacing:.5px}
.ed-srv .sub{font-size:14.5px;color:var(--ash)}
.ed-srv.on{background:var(--blood);color:#fff;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.22),inset -3px -3px 0 rgba(0,0,0,.45)}
.ed-srv.on .sub{color:#ffd9d7}
.ed-srv.off,.ed-srv:disabled{background:var(--pit);color:#6d6b70;cursor:not-allowed;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.05),inset -2px -2px 0 rgba(0,0,0,.6)}
.ed-srv.off .sub,.ed-srv:disabled .sub{color:#6d6b70}
.ed-netinfo{margin:16px 0 0;color:var(--ash);font-size:15.5px}
.ed-netinfo.gone{color:var(--gold)}

/* a skin's own face, beside its file name */
.ed-table td.facecell{width:52px;padding-right:0}

/* ---------- a skin as a model you can turn around ---------- */
.sk-3d{display:grid;place-items:center;touch-action:none;cursor:grab;outline:0;
  padding:10px 0;min-height:60px}
.sk-3d.dragging{cursor:grabbing}
.sk-3d:focus-visible{outline:3px solid var(--ember);outline-offset:4px}
.sk-stage{perspective:900px;display:grid;place-items:center;overflow:hidden;padding:10px 0}
.sk-model{position:relative;transform-style:preserve-3d;will-change:transform}
.sk-box{position:absolute;left:50%;top:50%;transform-style:preserve-3d}
.sk-face{position:absolute;left:50%;top:50%;background-repeat:no-repeat;
  image-rendering:pixelated;backface-visibility:hidden}
.sk-3d.sk-waiting .sk-model{opacity:.25}
.sk-3d.sk-nope::after{content:"that image would not load";color:var(--ash);font-size:16px}

/* the panel the model sits in */
.ed-skinview{display:grid;grid-template-columns:minmax(220px,300px) 1fr;gap:clamp(14px,3vw,30px);
  align-items:start}
@media(max-width:720px){.ed-skinview{grid-template-columns:1fr}}
.ed-skinview .shot{background:#000;border:3px solid #000;padding:8px}
.ed-skinside h3{margin-top:0}
.ed-skinflat{image-rendering:pixelated;width:100%;max-width:256px;height:auto;
  background:#000;border:3px solid #000}
.sk-tip{color:var(--ash);font-size:16px;margin:10px 0 0}

/* a file name you can click, inside a table */
.ed-link{background:none;border:0;padding:0;font:inherit;font-weight:700;color:#fff;
  text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:4px;
  text-decoration-color:var(--blood);text-decoration-thickness:3px}
.ed-link:hover{color:var(--ember)}
.ed-link:focus-visible{outline:3px solid var(--ember);outline-offset:3px}

/* a person in a group, rather than a bot */
.ed-face.tile.person{background:#1d2a1d;color:#9ad48f}
/* a setting this page will not change */
.ed-locked{background:#000;border:3px solid #000;padding:11px 14px;display:grid;gap:3px}
.ed-locked b{color:var(--gold);font-weight:500}
.ed-locked span{color:var(--ash);font-size:15.5px}
