/* ============================================================
   Minecraft panel (UX bible: docs/ux/minecraft-panel-ux.md)
   Loaded after main.css + maparts.css. Pixel look: corners ≤ 4px,
   spacing in multiples of 4px. Every animation has a reduced-motion
   override at the bottom.
   ============================================================ */

:root {
  --mc-green: #6ee7a8;
  --mc-amber: #ffd166;
}

/* the panel's display rules must never beat the hidden attribute */
[hidden] { display: none !important; }

.mc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.mc-pixel { image-rendering: pixelated; }
.mc-no-scroll { overflow: hidden; }
.mc-page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 16px 64px; }
.mc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mc-row--end { justify-content: flex-end; margin-top: 16px; }
.mc-row--between { justify-content: space-between; }
.mc-dim { color: var(--text-dim); }
.mc-small { font-size: 12px; }
.mc-pink { color: var(--pink); }
.mc-stack > * + * { margin-top: 16px; }
.mc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---- Minecraft colour codes (UX §1) ---- */
.mc-c0 { color: #000000; } .mc-c1 { color: #0000AA; } .mc-c2 { color: #00AA00; } .mc-c3 { color: #00AAAA; }
.mc-c4 { color: #AA0000; } .mc-c5 { color: #AA00AA; } .mc-c6 { color: #FFAA00; } .mc-c7 { color: #AAAAAA; }
.mc-c8 { color: #555555; } .mc-c9 { color: #5555FF; } .mc-ca { color: #55FF55; } .mc-cb { color: #55FFFF; }
.mc-cc { color: #FF5555; } .mc-cd { color: #FF55FF; } .mc-ce { color: #FFFF55; } .mc-cf { color: #FFFFFF; }
.mc-l { font-weight: 700; }
.mc-o { font-style: italic; }
.mc-n { text-decoration: underline; }
.mc-m { text-decoration: line-through; }
.mc-n.mc-m { text-decoration: underline line-through; }

/* ---- 3.1 pixel button ---- */
.mc-btn {
  --shade: #c94d8d;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-pixel); font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 10px 16px; border-radius: var(--radius); border: 2px solid var(--shade);
  box-shadow: 0 4px 0 var(--shade);
  cursor: pointer; margin-bottom: 4px;
  transition: transform 60ms, box-shadow 60ms;
  white-space: nowrap; text-decoration: none;
}
a.mc-btn:hover { color: inherit; }
a.mc-btn--primary:hover, a.mc-btn--go:hover { color: var(--bg); }
.mc-btn:active:not(.is-disabled):not(.is-busy) { transform: translateY(4px); box-shadow: 0 0 0 var(--shade); }
.mc-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-btn--primary { background: var(--pink); color: var(--bg); --shade: #c94d8d; }
.mc-btn--go { background: var(--mc-green); color: var(--bg); --shade: #3fae78; }
.mc-btn--stop { background: var(--layer-2); color: var(--pink); border-color: var(--pink); --shade: #7a2c55; box-shadow: 0 4px 0 #7a2c55; }
.mc-btn--ghost { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; margin-bottom: 0; }
.mc-btn--ghost:active:not(.is-disabled) { transform: translateY(2px); box-shadow: none; }
.mc-btn--danger { background: transparent; color: var(--pink); border: 2px dashed var(--pink); box-shadow: none; margin-bottom: 0; }
.mc-btn--sm { font-size: 12px; padding: 6px 10px; }
.mc-btn--xl { font-size: 24px; padding: 16px 32px; min-width: 220px; box-shadow: 0 6px 0 var(--shade); margin-bottom: 6px; }
.mc-btn--xl:active:not(.is-disabled):not(.is-busy) { transform: translateY(6px); }
.mc-btn.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.mc-btn.is-busy { cursor: progress; }
.mc-btn--ghost:hover:not(.is-disabled) { border-color: var(--violet); }

.mc-dots { display: inline-flex; gap: 4px; align-items: center; height: 1.2em; }
.mc-dots > span { width: 4px; height: 4px; background: currentColor; animation: mc-dot 900ms steps(1) infinite; }
.mc-dots > span:nth-child(2) { animation-delay: 300ms; }
.mc-dots > span:nth-child(3) { animation-delay: 600ms; }
@keyframes mc-dot { 0% { opacity: 1; } 33% { opacity: 0.25; } 100% { opacity: 0.25; } }

/* ---- 3.2 status pill ---- */
.mc-status { position: relative; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 12px; color: var(--text); }
.mc-status__dot { width: 8px; height: 8px; background: var(--border); flex: none; }
.mc-status.is-online .mc-status__dot { background: var(--mc-green); animation: mc-glow 2s ease-in-out infinite; }
.mc-status.is-starting .mc-status__dot, .mc-status.is-stopping .mc-status__dot { background: var(--mc-amber); animation: mc-blink 1s steps(1) infinite; }
.mc-status.is-sleeping .mc-status__dot { background: var(--blue); }
.mc-status.is-offline .mc-status__dot { background: var(--text-dim); }
.mc-status.is-crashed .mc-status__dot { background: var(--pink); }
.mc-status.is-crashed .mc-status__label { color: var(--pink); }
.mc-zzz { display: none; position: absolute; left: 0; top: -4px; width: 8px; height: 8px; pointer-events: none; }
.mc-status.is-sleeping .mc-zzz { display: block; }
.mc-zzz > span { position: absolute; left: 2px; bottom: 0; font-size: 8px; color: var(--blue); opacity: 0; animation: mc-zzz 4s linear infinite; }
.mc-zzz > span:nth-child(2) { animation-delay: 300ms; left: 6px; }
.mc-zzz > span:nth-child(3) { animation-delay: 600ms; left: 10px; }
@keyframes mc-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.6); } 50% { box-shadow: 0 0 6px 2px rgba(110, 231, 168, 0.45); } }
@keyframes mc-blink { 0% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes mc-zzz { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: 1; } 40% { opacity: 0; transform: translateY(-14px); } 100% { opacity: 0; } }

/* ---- 3.3 bars ---- */
.mc-bar { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.mc-bar__label { font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim); min-width: 32px; }
.mc-bar__track { display: inline-flex; gap: 2px; }
.mc-bar__seg { width: 6px; height: 10px; background: var(--layer-2); transition: background-color 0ms linear; }
.mc-bar--ram .mc-bar__seg.on, .mc-bar--disk .mc-bar__seg.on { background: var(--violet); }
.mc-bar--cpu .mc-bar__seg.on { background: var(--blue); }
.mc-bar[data-level="warn"] .mc-bar__seg.on { background: var(--mc-amber); }
.mc-bar[data-level="critical"] .mc-bar__seg.on { background: var(--pink); }
.mc-bar__value { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }

/* ---- 3.4 cards ---- */
.mc-card { background: var(--layer); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.mc-card__title { font-family: var(--font-pixel); font-size: 14px; color: var(--text-dim); text-transform: uppercase; margin: 0 0 12px; letter-spacing: 0.02em; }
.mc-card--danger { border: 2px dashed var(--pink); }
.mc-card--crash { border: 2px solid var(--pink); }

/* ---- 3.5 tabs ---- */
.mc-tabs { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; margin: 24px 0 16px; }
.mc-tab { scroll-snap-align: start; font-family: var(--font-pixel); font-size: 12px; white-space: nowrap; border-bottom-width: 1px; }
.mc-tab.active { color: var(--pink); box-shadow: inset 0 -2px 0 var(--pink); }
.mc-tab:focus-visible, .chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- 3.6 toasts ---- */
.mc-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.mc-toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; background: var(--layer); border: 2px solid var(--blue); border-radius: var(--radius); font-size: 14px; animation: mc-toast-in 160ms ease-out; }
.mc-toast__glyph { font-family: var(--font-pixel); flex: none; width: 16px; text-align: center; }
.mc-toast--ok { border-color: var(--mc-green); } .mc-toast--ok .mc-toast__glyph { color: var(--mc-green); }
.mc-toast--info { border-color: var(--blue); } .mc-toast--info .mc-toast__glyph { color: var(--blue); }
.mc-toast--warn { border-color: var(--violet); } .mc-toast--warn .mc-toast__glyph { color: var(--violet); }
.mc-toast--error { border-color: var(--pink); } .mc-toast--error .mc-toast__glyph { color: var(--pink); }
@keyframes mc-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- 3.7 modal / confirm / drawer ---- */
.mc-modal { position: fixed; inset: 0; z-index: 50; background: rgba(14, 10, 20, 0.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mc-modal__box { background: var(--layer); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.mc-modal__box--wide { width: min(640px, 100%); }
.mc-modal__title { font-family: var(--font-pixel); font-size: 18px; margin: 0 0 16px; color: var(--text); }
.mc-confirm__body { margin-bottom: 16px; }
.mc-modal--drawer { justify-content: flex-end; padding: 0; }
.mc-modal--drawer .mc-modal__box { height: 100vh; max-height: none; width: min(520px, 100%); border-width: 0 0 0 2px; border-radius: 0; }

/* ---- 3.8 skeleton ---- */
.mc-skel-group { display: grid; gap: 8px; }
.mc-skel { height: 16px; width: 70%; border-radius: var(--radius); background: var(--layer-2) linear-gradient(110deg, transparent 30%, var(--border) 50%, transparent 70%) no-repeat; background-size: 200% 100%; animation: mc-shimmer 1.2s linear infinite; }
.mc-skel--wide { width: 100%; height: 24px; }
@keyframes mc-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---- 3.9 empty ---- */
.mc-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 16px; }
.mc-blossom { image-rendering: pixelated; }
.mc-empty__title { font-family: var(--font-pixel); font-size: 16px; color: var(--text); margin-top: 8px; }
.mc-empty__sub { color: var(--text-dim); margin-bottom: 8px; }

/* ---- 3.10 address pill ---- */
.mc-address-wrap { display: inline-flex; flex-direction: column; gap: 4px; max-width: 100%; }
.mc-address { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; font-family: var(--font-mono); font-size: 18px; color: var(--text); background: var(--layer-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; cursor: copy; transition: border-color 120ms; text-align: left; }
.mc-address__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-steps-list .mc-address-wrap { display: flex; width: 100%; }
.mc-address-wrap--big .mc-address { font-size: 24px; padding: 8px 16px; }
.mc-address:hover { border-color: var(--violet); }
.mc-address:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-address.is-copied { border-color: var(--mc-green); }
.mc-address__hint { font-size: 12px; color: var(--text-dim); }
/* pixel clipboard glyph (4px pixels) */
.mc-clip { position: relative; flex: none; width: 12px; height: 16px; border: 2px solid var(--text-dim); border-radius: 0; }
.mc-clip::before { content: ''; position: absolute; left: 1px; top: -4px; width: 6px; height: 4px; background: var(--text-dim); }

/* ---- 3.12 / 3.13 icon + preview ---- */
.mc-icon { image-rendering: pixelated; background: var(--layer-2); flex: none; }
.mc-icon--64 { width: 64px; height: 64px; }
.mc-icon--40 { width: 40px; height: 40px; }
.mc-icon--32 { width: 32px; height: 32px; }
.mc-preview {
  display: flex; gap: 8px; max-width: 520px; padding: 6px; font-family: var(--font-pixel); font-size: 13px; line-height: 1.5;
  background-color: rgba(0, 0, 0, 0.6);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    repeating-linear-gradient(90deg, #4a3423 0 8px, #5b402b 8px 16px),
    repeating-linear-gradient(0deg, #3d2a1c 0 8px, #4f3726 8px 16px);
  background-blend-mode: normal, overlay, normal;
  border-radius: 2px;
}
.mc-preview__icon { width: 64px; height: 64px; flex: none; }
.mc-preview__text { min-width: 0; flex: 1; max-width: 440px; }
.mc-preview__l1 { display: flex; justify-content: space-between; gap: 8px; }
.mc-preview__name { color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-preview__side { display: inline-flex; gap: 6px; align-items: center; color: #AAAAAA; flex: none; }
.mc-ping { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; }
.mc-ping > span { width: 2px; background: #55FF55; }
.mc-ping > span:nth-child(1) { height: 2px; } .mc-ping > span:nth-child(2) { height: 4px; } .mc-ping > span:nth-child(3) { height: 6px; }
.mc-ping > span:nth-child(4) { height: 8px; } .mc-ping > span:nth-child(5) { height: 10px; }
.mc-preview__motd { color: #AAAAAA; }
.mc-preview__line { white-space: pre; overflow: hidden; text-overflow: ellipsis; }

/* ---- 3.11 petals ---- */
.mc-petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mc-petal { position: absolute; top: -8px; width: 4px; height: 4px; background: var(--pink); animation: mc-fall 1.6s ease-in forwards; }
.mc-petal--light { background: #ffaed6; }
@keyframes mc-fall { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--drift, 0), 260px); opacity: 0; } }

/* ---- agent banner ---- */
.mc-agent-banner { position: sticky; top: 0; z-index: 40; padding: 12px 16px; background: var(--mc-amber); color: var(--bg); text-align: center; font-size: 14px; }

/* ---- forms ---- */
.mc-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; min-width: 0; }
.mc-label { font-size: 13px; color: var(--text-dim); }
.mc-input, .mc-select {
  font-family: var(--font-mono); font-size: 14px; color: var(--text); background: var(--layer-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; max-width: 100%;
}
.mc-input:focus-visible, .mc-select:focus-visible, .mc-check input:focus-visible, .mc-range:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-input[aria-invalid="true"] { border-color: var(--pink); }
.mc-hint { font-size: 12px; color: var(--text-dim); }
.mc-field__error { font-size: 12px; color: var(--pink); }
.mc-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.mc-check input { accent-color: var(--pink); width: 16px; height: 16px; }
.mc-range { width: 100%; max-width: 320px; accent-color: var(--violet); }
.mc-range::-webkit-slider-thumb { border-radius: 0; }
.mc-range::-moz-range-thumb { border-radius: 0; width: 12px; height: 16px; background: var(--violet); border: 2px solid var(--bg); }
.mc-form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mc-saved { font-size: 12px; color: var(--mc-green); }

/* ---- list page ---- */
.mc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.mc-h1 { font-family: var(--font-pixel); font-size: 28px; line-height: 1.2; color: var(--text); }
.mc-h1__mark { color: var(--pink); }
.mc-sub { font-size: 14px; color: var(--text-dim); }
.mc-server-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color 120ms; }
.mc-server-card:hover { border-color: var(--violet); }
.mc-server-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-server-card__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mc-server-card__name { font-family: var(--font-pixel); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mc-server-card .mc-address { font-size: 14px; }
.mc-server-card .mc-address__hint { display: none; }
.mc-server-card__actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.mc-chip { font-size: 12px; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-dim); background: var(--layer-2); }
.mc-chip--violet { color: var(--violet); border-color: var(--violet); }
.mc-chip--blue { color: var(--blue); border-color: var(--blue); }
.mc-chip--pink { color: var(--pink); border-color: var(--pink); }
.mc-chip--green { color: var(--mc-green); border-color: var(--mc-green); }
.mc-chip--amber { color: var(--mc-amber); border-color: var(--mc-amber); }
.mc-limits { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.mc-limits b { font-family: var(--font-pixel); font-weight: 400; margin-right: 8px; }

/* ---- wizard ---- */
.mc-steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.mc-steps > span { width: 8px; height: 8px; background: var(--border); }
.mc-steps > span.on { background: var(--pink); }
.mc-addr-preview { color: var(--blue); font-size: 14px; word-break: break-all; }
.mc-avail { font-size: 13px; min-height: 1.5em; }
.mc-avail.ok { color: var(--mc-green); }
.mc-avail.bad { color: var(--pink); }
.mc-soft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.mc-soft { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--layer-2); cursor: pointer; }
.mc-soft:has(input:checked) { border-color: var(--pink); }
.mc-soft:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-soft input { position: absolute; opacity: 0; pointer-events: none; }
.mc-soft__name { font-family: var(--font-pixel); font-size: 14px; display: flex; align-items: center; gap: 12px; }
.mc-soft__desc { font-size: 12px; color: var(--text-dim); }
.mc-summary { background: var(--layer-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 13px; display: grid; gap: 4px; margin: 12px 0; }
.mc-summary dt { color: var(--text-dim); }
.mc-summary div { display: flex; justify-content: space-between; gap: 12px; }

/* 24px pixel glyphs: one 4px "pixel" drawn by box-shadow on a 4×4 dot */
.mc-glyph { position: relative; width: 24px; height: 24px; flex: none; }
.mc-glyph::before { content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 4px; }
.mc-glyph--paper::before {
  background: #f4f1e8;
  box-shadow: 4px 0 #f4f1e8, 8px 0 #f4f1e8, 12px 0 #f4f1e8, 0 4px #f4f1e8, 4px 4px #aaa49a, 8px 4px #aaa49a, 12px 4px #f4f1e8, 16px 4px #f4f1e8,
    0 8px #f4f1e8, 4px 8px #f4f1e8, 8px 8px #f4f1e8, 12px 8px #f4f1e8, 16px 8px #f4f1e8, 0 12px #f4f1e8, 4px 12px #aaa49a, 8px 12px #aaa49a, 12px 12px #aaa49a, 16px 12px #f4f1e8,
    0 16px #f4f1e8, 4px 16px #f4f1e8, 8px 16px #f4f1e8, 12px 16px #f4f1e8, 16px 16px #f4f1e8, 0 20px #f4f1e8, 4px 20px #f4f1e8, 8px 20px #f4f1e8, 12px 20px #f4f1e8, 16px 20px #f4f1e8;
}
.mc-glyph--purpur::before {
  background: #a97fd8;
  box-shadow: 4px 0 #a97fd8, 8px 0 #c6a3ee, 12px 0 #a97fd8, 16px 0 #a97fd8, 20px 0 #7e57b0, 0 4px #c6a3ee, 4px 4px #a97fd8, 8px 4px #a97fd8, 12px 4px #7e57b0, 16px 4px #a97fd8, 20px 4px #a97fd8,
    0 8px #a97fd8, 4px 8px #7e57b0, 8px 8px #a97fd8, 12px 8px #a97fd8, 16px 8px #c6a3ee, 20px 8px #a97fd8, 0 12px #a97fd8, 4px 12px #a97fd8, 8px 12px #c6a3ee, 12px 12px #a97fd8, 16px 12px #a97fd8, 20px 12px #7e57b0,
    0 16px #7e57b0, 4px 16px #a97fd8, 8px 16px #a97fd8, 12px 16px #a97fd8, 16px 16px #7e57b0, 20px 16px #a97fd8, 0 20px #a97fd8, 4px 20px #c6a3ee, 8px 20px #7e57b0, 12px 20px #a97fd8, 16px 20px #a97fd8, 20px 20px #a97fd8;
}
.mc-glyph--fabric::before {
  background: transparent;
  box-shadow: 8px 0 #dbd3b6, 12px 0 #dbd3b6, 4px 4px #dbd3b6, 8px 4px #c2b48a, 12px 4px #c2b48a, 16px 4px #dbd3b6, 0 8px #dbd3b6, 4px 8px #c2b48a, 8px 8px #8a7a52, 12px 8px #8a7a52, 16px 8px #c2b48a, 20px 8px #dbd3b6,
    0 12px #dbd3b6, 4px 12px #c2b48a, 8px 12px #8a7a52, 12px 12px #8a7a52, 16px 12px #c2b48a, 20px 12px #dbd3b6, 4px 16px #dbd3b6, 8px 16px #c2b48a, 12px 16px #c2b48a, 16px 16px #dbd3b6, 8px 20px #dbd3b6, 12px 20px #dbd3b6;
}
.mc-glyph--vanilla::before {
  background: #6dbb3c;
  box-shadow: 4px 0 #5aa02f, 8px 0 #6dbb3c, 12px 0 #6dbb3c, 16px 0 #5aa02f, 20px 0 #6dbb3c, 0 4px #6dbb3c, 4px 4px #5aa02f, 8px 4px #6dbb3c, 12px 4px #5aa02f, 16px 4px #6dbb3c, 20px 4px #5aa02f,
    0 8px #8b5a2b, 4px 8px #6dbb3c, 8px 8px #8b5a2b, 12px 8px #8b5a2b, 16px 8px #6dbb3c, 20px 8px #8b5a2b, 0 12px #8b5a2b, 4px 12px #6f4520, 8px 12px #8b5a2b, 12px 12px #8b5a2b, 16px 12px #6f4520, 20px 12px #8b5a2b,
    0 16px #6f4520, 4px 16px #8b5a2b, 8px 16px #8b5a2b, 12px 16px #6f4520, 16px 16px #8b5a2b, 20px 16px #8b5a2b, 0 20px #8b5a2b, 4px 20px #8b5a2b, 8px 20px #6f4520, 12px 20px #8b5a2b, 16px 20px #8b5a2b, 20px 20px #6f4520;
}

/* ---- server page hero ---- */
.mc-back { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--blue); }
.mc-hero { position: relative; overflow: hidden; background: var(--layer); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px 24px; grid-template-columns: 64px 1fr auto; align-items: start; }
.mc-hero__icon { grid-row: span 3; }
.mc-hero__name { font-family: var(--font-pixel); font-size: 28px; line-height: 1.15; text-transform: uppercase; word-break: break-word; }
.mc-hero__main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mc-hero__side { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.mc-hero__btns { display: flex; gap: 8px; align-items: flex-start; }
.mc-hero__meta { font-size: 14px; color: var(--text-dim); }
.mc-hero__bars { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px 32px; }
.mc-hero__note { grid-column: 1 / -1; font-size: 14px; color: var(--text-dim); }
.mc-progress { grid-column: 1 / -1; display: grid; gap: 8px; }
.mc-indeterminate { height: 4px; background: var(--layer-2); position: relative; overflow: hidden; }
.mc-indeterminate::after { content: ''; position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: var(--mc-amber); animation: mc-indet 1.2s linear infinite; }
@keyframes mc-indet { to { left: 100%; } }
.mc-lastline { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-menu { position: relative; }
.mc-menu__list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; background: var(--layer); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; display: flex; flex-direction: column; }
.mc-menu__item { text-align: left; background: transparent; border: 0; padding: 8px 12px; font-family: var(--font-pixel); font-size: 12px; color: var(--text); cursor: pointer; border-radius: var(--radius); }
.mc-menu__item:hover, .mc-menu__item:focus-visible { background: var(--layer-2); outline: none; color: var(--pink); }
.mc-crash { margin-top: 16px; }
.mc-crash pre { font-family: var(--font-mono); font-size: 12px; background: var(--bg); padding: 8px; overflow-x: auto; margin: 8px 0 12px; border-radius: var(--radius); }
.mc-admin-banner { background: var(--violet); color: var(--bg); padding: 8px 16px; border-radius: var(--radius); margin-bottom: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-family: var(--font-pixel); font-size: 12px; }
.mc-admin-banner a, .mc-admin-banner button { color: var(--bg); background: transparent; border: 0; font: inherit; cursor: pointer; text-decoration: underline; }

/* ---- overview tab ---- */
.mc-steps-list { padding-left: 20px; display: grid; gap: 8px; }
.mc-activity { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.mc-activity time { color: var(--text-dim); }

/* ---- console ---- */
.mc-console { position: relative; }
.mc-console__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.mc-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-pixel); font-size: 11px; }
.mc-live::before { content: ''; width: 8px; height: 8px; background: var(--text-dim); }
.mc-live.is-live::before { background: var(--mc-green); }
.mc-live.is-reconnecting::before { background: var(--mc-amber); animation: mc-blink 1s steps(1) infinite; }
.mc-log { height: min(70vh, 640px); overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }
.mc-log__line { white-space: pre; min-height: 1.5em; }
.mc-log.is-wrapped .mc-log__line { white-space: pre-wrap; word-break: break-word; }
.mc-log .t { color: var(--text-dim); }
.mc-log .lv-warn { color: var(--mc-amber); }
.mc-log .lv-error { color: var(--pink); }
.mc-log .ok { color: var(--mc-green); }
.mc-log .join { color: var(--blue); }
.mc-log .resp { color: var(--violet); }
.mc-newlines { position: absolute; right: 24px; bottom: 88px; }
.mc-cmd { display: flex; gap: 8px; align-items: center; margin-top: 8px; background: var(--layer-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 4px 4px 12px; }
.mc-cmd__prompt { font-family: var(--font-pixel); color: var(--pink); }
.mc-cmd input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 6px 0; font-family: var(--font-mono); font-size: 14px; }
.mc-cmd input:focus-visible { outline: none; }
.mc-cmd:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-cmd.is-disabled { opacity: 0.5; }
.mc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- players / plugins / lists ---- */
.mc-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.mc-list li { display: flex; align-items: center; gap: 12px; padding: 6px 8px; background: var(--layer-2); border-radius: var(--radius); min-width: 0; }
.mc-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mc-x { background: transparent; border: 0; color: var(--text-dim); font-family: var(--font-pixel); cursor: pointer; padding: 4px 8px; }
.mc-x:hover, .mc-x:focus-visible { color: var(--pink); outline: 2px solid var(--blue); outline-offset: 0; }
.mc-head-img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.mc-silhouette { width: 24px; height: 24px; flex: none; background: var(--border); position: relative; }
.mc-silhouette::before { content: ''; position: absolute; left: 8px; top: 4px; width: 8px; height: 8px; background: var(--text-dim); }
.mc-silhouette::after { content: ''; position: absolute; left: 4px; top: 14px; width: 16px; height: 10px; background: var(--text-dim); }
.mc-banner { padding: 12px 16px; border: 1px solid var(--violet); border-radius: var(--radius); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.mc-banner--amber { border-color: var(--mc-amber); }
.mc-result { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px; background: var(--layer-2); border-radius: var(--radius); }
.mc-result img, .mc-result .mc-result__ph { width: 40px; height: 40px; border-radius: var(--radius); background: var(--border); object-fit: cover; }
.mc-result__title { font-family: var(--font-pixel); font-size: 13px; }
.mc-result__desc { font-size: 12px; color: var(--text-dim); }
.mc-tag { font-size: 11px; padding: 0 6px; border: 1px solid var(--mc-amber); color: var(--mc-amber); border-radius: var(--radius); margin-left: 6px; }

/* ---- tables (admin) ---- */
.mc-table-wrap { overflow-x: auto; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table th { text-align: left; font-family: var(--font-pixel); font-size: 11px; color: var(--text-dim); font-weight: 400; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mc-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mc-table tbody tr:nth-child(even) { background: var(--layer-2); }
.mc-table tr.is-click { cursor: pointer; }
.mc-table tr.is-click:hover { background: var(--border); }
.mc-table tr.is-click:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mc-subnav { margin: 0 0 16px; }
.mc-host-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mc-host-grid .mc-bar { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
.mc-host-grid .mc-bar__label { min-width: 52px; }
.mc-floor { position: relative; }
.mc-floor-tick { font-size: 12px; color: var(--pink); }
.mc-sev { font-family: var(--font-pixel); font-size: 10px; padding: 1px 6px; border: 1px solid; border-radius: var(--radius); }
.mc-sev--info { color: var(--blue); } .mc-sev--warn { color: var(--violet); } .mc-sev--error { color: var(--pink); }
.mc-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.mc-gate { max-width: 420px; }

/* ---- /account card ---- */
.mc-account-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mc-account-card__text { flex: 1; min-width: 200px; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .mc-hero { grid-template-columns: 64px 1fr; }
  .mc-hero__side { grid-column: 1 / -1; align-items: stretch; }
}
@media (max-width: 640px) {
  .mc-page { padding-top: 16px; }
  .mc-grid { grid-template-columns: 1fr; }
  .mc-head > .mc-btn { width: 100%; }
  .mc-soft-grid { grid-template-columns: 1fr; }
  .mc-toasts { left: 16px; right: 16px; margin: 0 auto; align-items: center; }
  .mc-hero { padding: 16px; grid-template-columns: 48px 1fr; }
  .mc-hero__icon { grid-row: auto; width: 48px; height: 48px; }
  .mc-hero__name { font-size: 22px; }
  /* UX §8: icon + name, then the status, then the full-width button, then the address */
  .mc-hero__main { display: contents; }
  .mc-hero__icon { order: 1; }
  .mc-hero__name { order: 2; align-self: center; }
  .mc-hero__side { order: 3; grid-column: 1 / -1; align-items: stretch; }
  .mc-hero .mc-address-wrap--big { order: 4; grid-column: 1 / -1; }
  .mc-hero__meta { order: 5; grid-column: 1 / -1; }
  .mc-hero__bars { order: 6; }
  .mc-progress { order: 7; }
  .mc-hero__note { order: 8; }
  .mc-hero__btns { flex-direction: row; }
  .mc-hero__btns .mc-btn--xl { flex: 1; min-width: 0; }
  .mc-address-wrap--big .mc-address { font-size: 16px; }
  .mc-bar__seg { width: 5px; }
  .mc-modal--drawer .mc-modal__box { width: 100%; border-width: 0; }
  .mc-newlines { bottom: 120px; }
}

/* ---- reduced motion: no petals, blinking, zzz, shimmer, bar or toast animation ---- */
@media (prefers-reduced-motion: reduce) {
  .mc-btn, .mc-bar__seg, .mc-address, .mc-toast { transition: none !important; animation: none !important; }
  .mc-bar__seg { transition-delay: 0ms !important; }
  .mc-status__dot, .mc-zzz > span, .mc-dots > span, .mc-live::before, .mc-skel, .mc-indeterminate::after { animation: none !important; }
  .mc-zzz { display: none !important; }
  .mc-petals { display: none !important; }
  .mc-indeterminate::after { left: 0; width: 100%; opacity: 0.6; }
}
.mc-wizard > .mc-row--between { margin-top: 16px; }
.mc-modal fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 12px; margin: 0 0 16px; min-width: 0; }
.mc-modal fieldset legend { padding: 0 4px; }
.mc-modal fieldset .mc-check { margin-right: 16px; }
.mc-modal select[multiple] { display: block; width: 100%; margin-top: 8px; }
.mc-modal select[multiple]:disabled { opacity: 0.45; }

/* ── Phase 3: worlds, backups, schedule, server list, tools ──────────────── */
.mc-mono { font-family: var(--font-mono, monospace); }
.mc-subtitle { font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim); font-weight: 400; margin: 0; }
.mc-note { font-size: 13px; margin: 8px 0; }
.mc-note--amber { color: var(--mc-amber); }

.mc-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px 16px; text-align: center; cursor: pointer; background: var(--layer-2); }
.mc-drop:hover, .mc-drop.is-over { border-color: var(--pink); }
.mc-drop:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mc-drop.is-disabled { cursor: not-allowed; opacity: 0.55; }
.mc-drop__title { margin: 0 0 4px; }
.mc-drop--small { padding: 12px; }
.mc-upload .mc-bar { flex: 1; min-width: 200px; }
.mc-upload__checking { margin: 8px 0 0; }
.mc-tip summary { cursor: pointer; color: var(--text-dim); }
.mc-tip p { margin: 8px 0 0; }

.mc-palette { display: flex; flex-wrap: wrap; gap: 4px; }
.mc-swatch { width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 2px; cursor: pointer; font-family: var(--font-pixel); font-size: 10px; line-height: 18px; color: var(--text); background: var(--layer-2); }
.mc-swatch:hover { transform: translateY(-1px); border-color: var(--text); }
.mc-swatch:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.mc-swatch--fmt { width: 24px; }
.mc-counter { display: block; text-align: right; font-size: 12px; color: var(--text-dim); }
.mc-counter.is-over { color: var(--pink); }
.mc-icon-prev { image-rendering: pixelated; border: 1px solid var(--border); background: var(--layer-2); }

.mc-sched { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--layer-2); }
.mc-sched__text { margin: 0; }
.mc-preview-text { min-height: 1.4em; margin: 0; color: var(--mc-green); }
.mc-preview-text[data-state="error"] { color: var(--pink); }

.mc-tools > * + * { margin-top: 16px; }
.mc-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.mc-kv dt { color: var(--text-dim); }
.mc-kv dd { margin: 0; }
.mc-help { border-left: 3px solid var(--violet); padding: 8px 12px; background: var(--layer-2); font-size: 13px; }

@media (max-width: 640px) {
  .mc-upload .mc-bar { min-width: 0; width: 100%; }
  .mc-sched { flex-direction: column; align-items: flex-start; }
}
