/* Minecraft layout: servers on the left, the chosen server on the right.
   Colours, fonts and buttons come from the central site's theme. */
html, body { height: 100%; }
body { padding: 0; }
.mc { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); min-height: 100vh; }

.mc-list { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--surface); border-right: 1px solid var(--line); }
.mc-list-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.mc-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 10px; padding: 8px 10px; text-align: left;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--fg); cursor: pointer; font: inherit; }
.mc-item:hover { background: var(--surface2); }
.mc-item.is-on { border-color: var(--accent); background: var(--surface2); }
.mc-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-item small { grid-column: 2; color: var(--muted); font-size: .75rem; }
.mc-icon { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 8px; font: inherit; font-size: 1.1rem; }
.mc-icon:hover { color: var(--accent); }

.mc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.mc-dot.is-running { background: var(--ok, var(--accent)); box-shadow: var(--glow); }
.mc-dot.is-starting, .mc-dot.is-stopping, .mc-dot.is-busy { background: var(--warn); }

.mc-main { display: flex; flex-direction: column; min-width: 0; }
.mc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; padding: 16px 20px 8px; }
.mc-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.mc-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mc-tab { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; font: inherit; white-space: nowrap; }
.mc-tab:hover { color: var(--fg); }
.mc-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.mc-body { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 16px; }

.mc-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; align-items: baseline; }
.mc-facts dt { color: var(--muted); }
.mc-facts dd { margin: 0; overflow-wrap: anywhere; }
.mc-players { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mc-players li { padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.mc-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mc-buttons .btn + .btn { margin-left: 0; }
.mc-note { border-left: 2px solid var(--warn); padding: 8px 12px; }
.mc-muted, .mc-empty { color: var(--muted); font-size: .85rem; }
.btn-small { padding: 2px 10px; font-size: .8rem; }

.mc-console { height: min(60vh, 600px); margin: 0; padding: 10px; overflow: auto; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-command-row { display: flex; gap: 8px; }
.mc-command { flex: 1; font-family: monospace; }

.mc-table { width: 100%; border-collapse: collapse; }
.mc-table th, .mc-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.mc-table th { color: var(--muted); font-weight: normal; font-size: .8rem; }
.mc-row-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.mc-form { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.mc-form + .mc-form { padding-top: 16px; border-top: 1px solid var(--line); }
.mc-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .85rem; }
.mc-field.is-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.mc-field.is-check input { order: -1; }
.mc-field.is-check small { flex-basis: 100%; }
.mc-field small { font-size: .75rem; }
.mc-field textarea { font-family: monospace; font-size: .8rem; }
.mc-srv { display: block; margin-top: 4px; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: .8rem; }
.mc-access { display: flex; flex-direction: column; gap: 6px; }
.mc-access-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); }
.mc-access-row select, .mc-access-row input[type=text] { width: auto; flex: none; }
.mc-access-row input[type=text] { width: 12em; }
.mc-right { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; }

.mc-dialog { width: min(480px, calc(100vw - 32px)); padding: 16px; background: var(--surface); color: var(--fg); border: 1px solid var(--accent); border-radius: var(--radius); }
.mc-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.mc-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; padding: 8px 14px; background: var(--fg); color: var(--bg); border-radius: var(--radius); }

.mc-note-page { padding: 32px; }

@media (max-width: 700px) {
  .mc { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .mc-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 35vh; overflow-y: auto; }
  .mc-head, .mc-body { padding-left: 16px; padding-right: 16px; }
  .mc-tabs { padding: 0 16px; }
}

/* Overview tiles */
.mc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mc-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mc-tile small { color: var(--muted); font-size: .75rem; }
.mc-tile b { font-size: 1.3rem; font-family: var(--font-display), monospace; }
.mc-tile span { color: var(--muted); font-size: .75rem; }
.mc-tile.is-warn { border-color: var(--warn); }
.mc-tile.is-warn b { color: var(--warn); }

/* Files */
.mc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mc-link { border: 0; padding: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
.mc-link:hover { text-decoration: underline; }
.mc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mc-upload input[type=file] { max-width: 100%; }
.mc-form.is-wide { max-width: none; }
.mc-editor { min-height: 60vh; font-family: monospace; font-size: .8rem; tab-size: 4; white-space: pre; }
/* The file editor: fills the page, line numbers beside it (same font, size, line height and padding as the text). */
.mc-edit.is-wide { max-width: none; }
.mc-find-row { display: flex; gap: 6px; align-items: center; }
.mc-find { flex: 0 1 260px; }
.mc-editor-wrap { display: flex; height: calc(100vh - 290px); min-height: 320px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.mc-editor-wrap .mc-editor, .mc-gutter { margin: 0; padding: 8px; font-family: monospace; font-size: .8rem; line-height: 1.45; }
.mc-editor-wrap .mc-editor { flex: 1; height: 100%; min-height: 0; border: 0; border-radius: 0; resize: none; overflow: auto; background: transparent; }
.mc-gutter { flex: none; min-width: 3.2em; overflow: hidden; text-align: right; color: var(--muted); background: var(--surface); border-right: 1px solid var(--line); user-select: none; white-space: pre; }
.mc-toast.is-action { display: flex; align-items: center; gap: 8px; }

/* Busy controls: a small spinning ring, drawn with CSS */
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1em; height: 1em; border: 2px solid var(--fg); border-right-color: transparent;
  border-radius: 50%; animation: mc-spin .7s linear infinite; }
.btn-primary.is-busy::after { border-color: var(--bg); border-right-color: transparent; }
@keyframes mc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after { animation-duration: 2s; } }

/* Progress: uploads and starting */
.mc-progress { width: 100%; max-width: 480px; height: 8px; accent-color: var(--accent); }
.mc-upload-progress { display: flex; flex-direction: column; gap: 4px; }
.mc-starting { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--warn); border-radius: var(--radius); background: var(--surface); }
.mc-starting small { color: var(--muted); }

/* People and groups */
.mc-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--fg); text-decoration: none; }
a.mc-who:hover b { color: var(--accent); text-decoration: underline; }
.mc-who small { color: var(--muted); font-size: .75rem; }
.mc-who-picture, .mc-who-icon { width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface2); color: var(--accent); object-fit: cover; font-size: .85rem; }
.mc-who-icon { border-radius: var(--radius); }
.mc-access-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.mc-access-row .mc-who { overflow: hidden; }
@media (max-width: 700px) { .mc-access-row { grid-template-columns: minmax(0, 1fr) auto; } .mc-access-row .mc-rights { grid-column: 1 / -1; grid-row: 2; } }
.mc-rights { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.mc-picker { position: relative; max-width: 420px; }
.mc-search { width: 100%; }
.mc-found { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); }
.mc-found-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius); background: none; color: var(--fg);
  cursor: pointer; font: inherit; text-align: left; }
.mc-found-item:hover, .mc-found-item:focus { background: var(--surface2); }
.mc-found-item small { color: var(--muted); font-size: .75rem; }
.mc-found-item .mc-who-picture { width: 24px; height: 24px; }
.mc-choose-cell { width: 28px; }
.mc-warn { color: var(--warn); }
.mc-recent { margin: 6px 0 0; padding-left: 18px; font-size: .8rem; color: var(--muted); }
