/* VoxiGames Panel. Colours come from the logo: near-black, white and gold. Gold is the accent only. */

:root {
  --bg: #09090b;
  --surface: #131316;
  --raised: #1c1c20;
  --line: #27272a;
  --line-strong: #3f3f46;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --gold: #ffd700;
  --gold-ink: #09090b;
  --green: #4ade80;
  --blue: #60a5fa;
  --red: #f87171;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-sm: 7px;

  /* One spacing scale for the whole panel: gaps between blocks are --space-3, inside cards --space-4. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
h1:focus { outline: none; }
p { margin: 0; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
code { font-family: var(--font-mono); font-size: 0.88em; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.nums { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------ layout */

.app { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.1rem 0.75rem;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0.6rem 0.9rem; }
.sidebar-logo, .topbar-logo { display: block; }
.sidebar-logo img, .topbar-logo img { display: block; height: 1.75rem; width: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.icon-button { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); cursor: pointer; }
.icon-button:hover { background: var(--raised); }
.icon-button .mud-icon-root { font-size: 1.4rem; }
/* The top bar, the drawer's close button and the shade behind the drawer only exist on small screens (see below). */
.topbar, .scrim, .menu-close { display: none; }
.nav-label { color: var(--muted); font-size: 0.78rem; padding: 0.9rem 0.75rem 0.3rem; }
/* The administration group folds away while a server is open. */
.nav-fold { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 0.6rem; padding: 0.4rem 0.75rem; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; font: inherit; font-size: 0.78rem; cursor: pointer; }
.nav-fold:hover { color: var(--text); }
.nav-fold .mud-icon-root { font-size: 1.1rem; transition: transform 0.15s; }
.nav-fold[aria-expanded="false"] .mud-icon-root { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group[hidden] { display: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--raised); }
.nav-link.active .mud-icon-root { color: var(--gold); }
.nav-link .mud-icon-root { font-size: 1.15rem; }
.nav-server { display: flex; align-items: center; gap: 0.6rem; margin: 0.75rem 0 0.25rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.nav-server .game-badge { width: 1.75rem; height: 1.75rem; font-size: 0.65rem; border-radius: 5px; }
.nav-server b { display: block; font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-server .status { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.nav-link.sub { padding-left: 1rem; }
.sidebar-foot { margin-top: auto; padding: 0.9rem 0.75rem 0; border-top: 1px solid var(--line); font-size: 0.87rem; }
.sidebar-foot .who { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot a { color: var(--muted); }

.main { padding: 1.6rem 2rem 3rem; min-width: 0; }
/* Focus is moved here after choosing a page in the phone menu; the whole page lighting up would say nothing. */
.main:focus { outline: none; }
.main > .inner { max-width: 110rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { color: var(--muted); margin-top: 0.25rem; max-width: 70ch; }
.back { display: inline-block; color: var(--muted); font-size: 0.87rem; margin-bottom: 0.8rem; text-decoration: none; }
.back:hover { color: var(--text); }

.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel > h2 + p, .panel > .spread + p { color: var(--muted); margin: 0.25rem 0 1rem; max-width: 70ch; }
.panel.danger { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.03); }
.panel.danger > h2 { color: var(--red); font-size: 0.95rem; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.panel.danger > h2 + .danger-row { margin-top: 0.6rem; }
.danger-row:last-child { padding-bottom: 0; }
.danger-row > div { flex: 1 1 22rem; min-width: 0; }
.danger-row p { margin-top: 0.15rem; max-width: 70ch; }

/* Settings: one part at a time. */
.settings-nav { margin-bottom: var(--space-4); flex-wrap: wrap; }
.segments a { font-weight: 500; color: var(--muted); text-decoration: none; border-radius: 5px; padding: 0.35rem 0.9rem; }
.segments a:hover { color: var(--text); }
.segments a[aria-current="page"] { color: var(--gold); background: var(--raised); }
.settings-section[hidden] { display: none; }
/* The blocks of a settings part keep the same distance to each other as the cards inside a grid. */
.settings-section { display: flex; flex-direction: column; gap: var(--space-4); }
.settings-section > .panel + .panel, .settings-section > .panel-grid + .panel { margin-top: 0; }
.kv.about { margin-top: 0.7rem; grid-template-columns: max-content minmax(0, 1fr); }
.kv.about dd { text-align: left; white-space: normal; overflow-wrap: anywhere; }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; }
.empty h2 { margin-bottom: 0.4rem; }
.empty p { color: var(--muted); max-width: 48ch; margin: 0 auto; }
.empty .mud-button-root { margin-top: 1.1rem; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.5rem 0.85rem;
  margin-bottom: var(--space-3);
  font-size: 0.92rem;
}
.banner.warn { border-left-color: var(--red); }
/* A notice is one line where it fits: an icon, what is going on, and what to do about it. */
.banner > .mud-icon-root { flex: none; font-size: 1.15rem; color: var(--blue); }
.banner.warn > .mud-icon-root { color: var(--red); }
.banner-text { flex: 1 1 16rem; min-width: 0; }
.banner > .mud-button-root { flex: none; }

/* A short line under a heading, with "Learn more" for the long story. */
.intro-hint { color: var(--muted); max-width: 72ch; }
.intro-hint > p { margin: 0; }
.intro-hint .hint-more { margin-top: var(--space-2); font-size: 0.9rem; }
.hint-toggle { font: inherit; font-size: 0.85rem; margin-left: 0.3rem; padding: 0; border: 0; background: none; color: var(--gold); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255, 215, 0, 0.4); text-underline-offset: 3px; white-space: nowrap; }
.hint-toggle:hover { text-decoration-color: var(--gold); }
.panel > h2 + .intro-hint { margin: 0.25rem 0 1rem; }
.tab-intro { margin-bottom: var(--space-4); }

/* ------------------------------------------------------------ schedules */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.preset { text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0.35rem; padding: 0.9rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); cursor: pointer; font: inherit; }
.preset span { color: var(--muted); font-size: 0.88rem; }
.preset:hover, .preset:focus-visible { border-color: rgba(255, 215, 0, 0.5); outline: none; }
.preset.blank { border-style: dashed; background: transparent; }
.schedule-list { display: flex; flex-direction: column; gap: 1rem; }
.schedule-list .panel + .panel { margin-top: 0; }
.schedule.off h2, .schedule.off .schedule-sentence { color: var(--muted); }
.schedule-sentence { margin: 0.3rem 0 0; color: var(--text); max-width: 80ch; }
.schedule-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-top: 0.7rem; font-size: 0.9rem; }
.bad-text { color: var(--red); }
.schedule-editor { display: flex; flex-direction: column; gap: 1.2rem; }
.schedule-editor section h3 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.choice, .day { font: inherit; cursor: pointer; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 999px; padding: 0.3rem 0.85rem; }
.choice.on, .day.on { color: var(--gold); border-color: rgba(255, 215, 0, 0.55); background: rgba(255, 215, 0, 0.08); }
.choice:focus-visible, .day:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.days { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.7rem; }
.day { padding: 0.25rem 0.6rem; min-width: 3rem; }
.times { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.time { display: inline-flex; align-items: center; gap: 0.2rem; }
.time input[type="time"] { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.35rem 0.5rem; color-scheme: dark; }
.schedule-preview { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.schedule-preview p { margin: 0.2rem 0 0; }
.link-button { font: inherit; font-size: 0.85rem; border: 0; background: none; padding: 0.1rem 0.2rem; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------------------ schedule blocks
   A Scratch-like editor: a gold "When" block, then coloured blocks that snap under it. Each colour group sets --bk,
   and everything in a block takes its tint from that. Drag and drop is in js/blocks.js; the ghost and drop line it
   draws sit outside the editor, so block styles here are not nested under it. */

.bk-c-chat { --bk: #c084fc; }
.bk-c-power { --bk: #4ade80; }
.bk-c-backups { --bk: #2dd4bf; }
.bk-c-console { --bk: #60a5fa; }
.bk-c-flow { --bk: #fbbf24; }

.bk-dialog .bk-dialog-content { padding-bottom: 0; }
.bk-workspace { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.bk-canvas { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.bk-count { text-align: right; }
.bk-notice { border-left: 3px solid var(--gold); background: rgba(255, 215, 0, 0.07); padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.9rem; }

.bk-block, .bk-hat, .bk-new { -webkit-user-select: none; user-select: none; }
.bk-block input, .bk-hat input { -webkit-user-select: text; user-select: text; }
.bk-block { background: color-mix(in srgb, var(--bk) 12%, var(--raised)); border: 1px solid color-mix(in srgb, var(--bk) 38%, transparent); border-left: 4px solid var(--bk); border-radius: 8px; }
.bk-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.25rem 0.3rem 0.15rem; min-height: 2.6rem; }
.bk-sentence { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.45rem; }
.bk-word { white-space: nowrap; }
.bk-hint { color: var(--muted); font-size: 0.82rem; flex: 1 1 14rem; }
.bk-icon { color: var(--bk); flex: none; }
.bk-num { flex: none; min-width: 1.1rem; text-align: center; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bk-grip { flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.9rem; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: grab; touch-action: none; }
.bk-grip:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.bk-grip:focus-visible { outline: 2px solid var(--bk); outline-offset: 1px; color: var(--text); }
.bk-more { flex: none; align-self: flex-start; }
.bk-more .mud-icon-button { padding: 0.3rem; color: var(--muted); }

.bk-slot { font: inherit; font-size: 0.9rem; color: var(--text); background: rgba(0, 0, 0, 0.32); border: 1px solid color-mix(in srgb, var(--bk, var(--gold)) 35%, var(--line-strong)); border-radius: 6px; padding: 0.2rem 0.45rem; min-height: 1.95rem; color-scheme: dark; max-width: 100%; }
.bk-slot:focus { outline: 2px solid var(--bk, var(--gold)); outline-offset: 1px; }
select.bk-slot { cursor: pointer; }
.bk-number { width: 4.4rem; }
.bk-text { flex: 1 1 12rem; min-width: 7rem; }
.bk-mono { font-family: var(--font-mono); font-size: 0.85rem; }
.bk-condition { display: contents; }
.bk-days { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.bk-days .day { min-width: 2.6rem; padding: 0.15rem 0.45rem; font-size: 0.85rem; }
.bk-check { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); cursor: pointer; }
.bk-check input { accent-color: var(--gold); width: 1rem; height: 1rem; }

.bk-stack { display: flex; flex-direction: column; gap: 0.35rem; min-height: 2.4rem; }
.bk-mouth { margin: 0 0.4rem 0 1.6rem; }
.bk-mouth > .bk-stack { background: var(--surface); border-radius: 6px; padding: 0.35rem; }
.bk-else { min-height: 2rem; padding-left: 0.6rem; }
.bk-foot { height: 0.55rem; }
.bk-add-here { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.25rem; font: inherit; font-size: 0.8rem; color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); border-radius: 6px; padding: 0.15rem 0.55rem 0.15rem 0.35rem; cursor: pointer; }
.bk-add-here:hover, .bk-add-here:focus-visible { color: var(--text); border-color: var(--bk, var(--gold)); outline: none; }
.bk-stack-empty > .bk-add-here { align-self: stretch; justify-content: center; padding: 0.55rem; }
.bk-empty { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 1.3rem 1rem; color: var(--muted); text-align: center; font-size: 0.9rem; }

.bk-hat { --bk: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--raised)); border: 1px solid rgba(255, 215, 0, 0.35); border-left: 4px solid var(--gold); border-radius: 16px 16px 8px 8px; padding: 0.2rem 0.4rem 0.3rem 0.5rem; }
.bk-hat > .bk-row { padding-left: 0; }
.bk-hat-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.1rem 0.3rem 0.4rem 1.6rem; }
.bk-hat-body p { margin: 0; }
.bk-hat-body .days, .bk-hat-body .times { margin: 0; }
.bk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.bk-zone-field { min-width: 15rem; flex: 0 1 18rem; }
.bk-only { border-top: 1px solid rgba(255, 215, 0, 0.15); padding-left: 1.6rem; flex-wrap: wrap; }

.bk-palette { grid-column: 1; grid-row: 1; position: sticky; top: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 15rem); min-height: 16rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.4rem 0.4rem 0.65rem; }
.bk-palette-body { overflow-y: auto; padding-right: 0.25rem; padding-bottom: 0.3rem; }
.bk-palette-toggle, .bk-narrow { display: none; }
.bk-hat > .bk-row > select { flex: 0 1 auto; min-width: 0; }
.bk-palette-title { display: block; }
.bk-palette-note { display: block; font-size: 0.8rem; color: var(--muted); margin: 0.1rem 0 0.2rem; }
.bk-palette-note .link-button { font-size: 0.8rem; padding-left: 0; }
.bk-cat h4 { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.55rem 0 0.25rem; }
.bk-cat-items { display: flex; flex-direction: column; gap: 0.25rem; }
.bk-new { display: flex; align-items: center; justify-content: flex-start; gap: 0.45rem; text-align: left; width: 100%; font: inherit; font-size: 0.88rem; color: var(--text); background: color-mix(in srgb, var(--bk) 12%, var(--raised)); border: 1px solid color-mix(in srgb, var(--bk) 38%, transparent); border-left: 4px solid var(--bk); border-radius: 7px; padding: 0.28rem 0.55rem; cursor: grab; }
.bk-new .mud-icon-root { color: var(--bk); }
.bk-new:hover { background: color-mix(in srgb, var(--bk) 22%, var(--raised)); }
.bk-new:focus-visible { outline: 2px solid var(--bk); outline-offset: 2px; }
.bk-trash-note { display: none; }
.bk-drag-block .bk-palette .bk-trash-note { display: flex; position: absolute; inset: 0; z-index: 2; align-items: center; justify-content: center; gap: 0.4rem; border-radius: inherit; border: 2px dashed var(--red); background: rgba(19, 19, 22, 0.88); color: var(--red); font-weight: 600; }
.bk-over-trash .bk-palette .bk-trash-note { background: rgba(80, 20, 20, 0.92); }

/* While dragging: the floating copy, the line where it lands, and the block it came from dimmed. */
.bk-ghost { position: fixed; left: 0; top: 0; z-index: 2000; margin: 0; pointer-events: none; opacity: 0.93; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.bk-dragging { opacity: 0.35; }
.bk-drop-line { position: fixed; z-index: 1999; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.22); pointer-events: none; }
.bk-drag-on, .bk-drag-on * { cursor: grabbing !important; }

@media (max-width: 760px) {
  .bk-workspace { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .bk-wide { display: none; }
  .bk-narrow { display: inline; }
  .bk-block .bk-row > .bk-icon { display: none; }
  .bk-block > .bk-row { align-items: flex-start; }
  .bk-block > .bk-row > .bk-grip { margin-top: 0.1rem; }
  .bk-canvas { grid-column: 1; }
  /* On a phone the palette is a bar at the bottom that opens into a sheet; while a block is dragged it becomes the bin. */
  .bk-palette { grid-column: 1; grid-row: 2; position: sticky; top: auto; bottom: 0; z-index: 5; max-height: none; min-height: 0; padding: 0.45rem; box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.5); }
  .bk-palette-toggle { display: flex; width: 100%; align-items: center; justify-content: center; gap: 0.35rem; font: inherit; font-weight: 600; color: var(--gold-ink); background: var(--gold); border: 0; border-radius: var(--radius-sm); padding: 0.55rem; cursor: pointer; }
  .bk-palette.open .bk-palette-toggle { color: var(--text); background: var(--raised); }
  .bk-palette-title { display: none; }
  .bk-palette:not(.open) .bk-palette-note, .bk-palette:not(.open) .bk-palette-body { display: none; }
  .bk-palette.open .bk-palette-note { margin-top: 0.45rem; }
  .bk-palette.open .bk-palette-body { max-height: 52dvh; overflow-y: auto; }
  .bk-cat-items { flex-direction: row; flex-wrap: wrap; }
  .bk-new { flex: 1 1 10rem; width: auto; cursor: pointer; }
  .bk-hint, .bk-num { display: none; }
  .bk-mouth { margin: 0 0.2rem 0 0.7rem; }
  .bk-mouth > .bk-stack { padding: 0.25rem; }
  .bk-hat-body, .bk-only { padding-left: 0.4rem; }
  .bk-zone-field { min-width: 0; flex: 1 1 100%; }
  .bk-text { flex-basis: 100%; }
}
@media (max-width: 600px) {
  /* The editor needs every pixel on a phone: the dialog takes the whole screen. */
  .mud-dialog.bk-dialog { margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .bk-dialog .bk-dialog-content { padding-inline: 0.75rem; }
}
.banner.stage { display: block; border-left-color: var(--gold); }
.stage-head { display: flex; justify-content: space-between; gap: 1rem; }
.stage-percent { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar.busy > i { width: 35%; animation: bar-busy 1.4s ease-in-out infinite; }
@keyframes bar-busy { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .bar.busy > i { width: 100%; opacity: 0.5; animation: none; } }

/* ------------------------------------------------------------ status */

.status { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); flex: none; }
.status.running::before { background: var(--green); }
.status.busy::before { background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.status.bad { color: var(--red); }
.status.bad::before { background: var(--red); }
.status .uptime { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { opacity: 0.35; } }

.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); margin-right: 0.45rem; }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }

.tag { display: inline-block; white-space: nowrap; font-size: 0.78rem; font-weight: 500; padding: 0.08rem 0.5rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.tag.gold { border-color: rgba(255, 215, 0, 0.45); color: var(--gold); }
.tag.bad { border-color: rgba(248, 113, 113, 0.45); color: var(--red); }

.game-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--game, #52525b);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
}
.game-badge.lg { width: 2.9rem; height: 2.9rem; font-size: 0.95rem; }
.game-badge.xl { width: 4rem; height: 4rem; font-size: 1.2rem; border-radius: var(--radius); }
.game-badge.has-icon { background: #1c1c20; border: 1px solid var(--line-strong); padding: 0.3rem; overflow: hidden; }
.game-badge.has-icon.lg { padding: 0.4rem; }
.game-badge.has-icon.xl { padding: 0.55rem; }
.game-badge.has-icon.fill { padding: 0; }
.game-badge img { display: block; width: 100%; height: 100%; object-fit: contain; }
.game-badge.fill img { object-fit: cover; }
.game-badge img.pixel { image-rendering: pixelated; }

.address {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.55rem;
  cursor: pointer;
}
.address:hover { border-color: var(--line-strong); background: var(--raised); }
.address svg { width: 0.8rem; height: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------ server list */

.list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.server-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 4.5rem 10.5rem auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.server-row:last-child { border-bottom: 0; }
.server-row:hover { background: var(--raised); }
.server-name { display: block; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name:hover { text-decoration: underline; }
.server-sub { color: var(--muted); font-size: 0.87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ server page */

.power { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* A server's sections as a row that scrolls sideways. Shown in the top bar on small screens. */
.tabs { display: flex; gap: 0.2rem; padding: 0 0.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; color: var(--muted); font-weight: 500; text-decoration: none; padding: 0.55rem 0.75rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--gold); }
.tabs a:focus-visible { outline-offset: -2px; }

.terminal-frame { background: #050506; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.terminal-tools { display: flex; align-items: center; gap: 0.15rem; padding: 0.3rem 0.45rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.terminal-tools button { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.terminal-tools button:hover { color: var(--gold); background: var(--raised); }
.terminal-tools .mud-icon-root { font-size: 1.15rem; }
.terminal-tools-gap { flex: 1; }
.terminal-search { display: flex; align-items: center; gap: 0.4rem; flex: 0 1 17rem; min-width: 5rem; height: 2rem; padding: 0 0.55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #050506; color: var(--muted); }
.terminal-search:focus-within { border-color: var(--gold); }
.terminal-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 0.87rem; }
.terminal-search input::placeholder { color: var(--muted); opacity: 0.7; }
.terminal-search-status { flex: none; color: var(--red); font-size: 0.82rem; white-space: nowrap; }
.terminal-search-status:not(:empty) { margin: 0 0.35rem; }
.terminal-view { position: relative; }
/* Tall enough to fill the window on a desktop; the smaller layouts further down set their own height. */
.terminal { height: max(22rem, calc(100vh - 24rem)); padding: 0.75rem 0.4rem 0.4rem 0.85rem; overflow: hidden; }
.terminal-latest { position: absolute; right: 1.25rem; bottom: 0.75rem; z-index: 5; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem 0.3rem 0.5rem; border: 1px solid var(--gold); border-radius: 999px; background: var(--raised); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6); }
.terminal-latest[hidden] { display: none; }
.terminal-latest:hover { background: var(--gold); color: var(--gold-ink); }
.terminal-latest .mud-icon-root { font-size: 1rem; }
.command { display: flex; align-items: center; gap: 0.6rem; border-top: 1px solid var(--line); padding: 0.55rem 0.85rem; color: var(--muted); font-family: var(--font-mono); }
.command input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 0.87rem; }
.command input:focus-visible { outline-offset: 4px; }
.command input::placeholder { color: var(--muted); opacity: 0.7; }

.spark { display: block; width: 100%; height: 2.2rem; margin-top: 0.35rem; }
.spark polyline { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark polygon { fill: rgba(255, 215, 0, 0.08); }

/* ------------------------------------------------------------ files */

.crumbs { display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.87rem; }
.crumbs button { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0.1rem 0.3rem; border-radius: 4px; }
.crumbs button:hover { background: var(--raised); }
.crumbs span { color: var(--muted); }

.file-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.file { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr) 6rem 9rem auto; align-items: center; gap: 0.75rem; padding: 0.35rem 0.6rem 0.35rem 1rem; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file:hover { background: var(--raised); }
.file-open { justify-self: start; max-width: 100%; background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-open:hover { text-decoration: underline; }
.file svg { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.file.dir svg { color: var(--gold); }
.file .muted { font-size: 0.85rem; }
.editor textarea {
  width: 100%;
  min-height: 28rem;
  resize: vertical;
  background: #050506;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  tab-size: 4;
}
.editor textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; }

/* ------------------------------------------------------------ tables, figures, forms */

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 0.82rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.panel.table-wrap { padding: 0.4rem 0.5rem; }
.table td.nowrap { white-space: nowrap; }
.table td .server-name { display: inline; }
.table td .server-name + .tag { margin-left: 0.4rem; }
.th-sort { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.th-sort:hover, .th-sort.active { color: var(--text); }
.th-sort .mud-icon-root { font-size: 0.95rem; }
th.num .th-sort { flex-direction: row-reverse; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; margin-top: 0.75rem; }
.pager > .muted { margin-right: auto; }

/* What happened to a server, newest first. */
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: 0.85rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--raised); color: var(--muted); }
.activity-icon.bad { color: var(--red); }
.activity-icon .mud-icon-root { font-size: 1.05rem; }
.activity-what { overflow-wrap: anywhere; }
.activity-what .tag { margin-left: 0.4rem; }
.activity-who { color: var(--muted); font-size: 0.85rem; }
.activity-when { color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 0.2rem 0.75rem; align-items: center; margin-bottom: 1rem; }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.9rem; }
.figure b { display: block; font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.figure span { color: var(--muted); font-size: 0.87rem; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: 0.3rem 1rem; }
.notice { color: var(--muted); font-size: 0.87rem; margin-top: 0.8rem; max-width: 75ch; }

.reveal { display: flex; align-items: center; gap: 0.75rem; background: #050506; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; font-family: var(--font-mono); font-size: 0.84rem; overflow-wrap: anywhere; }
pre.snippet { margin: 0.6rem 0 0; background: #050506; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6; overflow-x: auto; white-space: pre; }

/* ------------------------------------------------------------ sign in and other standalone pages */

.center-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(rgba(9, 9, 11, 0.62), rgba(9, 9, 11, 0.86)), url("img/backdrop.jpg") center / cover no-repeat;
}
.card { width: 100%; max-width: 23rem; background: rgba(19, 19, 22, 0.94); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.card-logo { display: block; height: 2rem; width: auto; margin-bottom: 1.5rem; }
.card h1 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.card > p { color: var(--muted); margin-bottom: 1.2rem; }
.card form { display: flex; flex-direction: column; gap: 0.8rem; }
.card label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.87rem; color: var(--muted); }
.card input[type="email"], .card input[type="password"] { background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); font: inherit; padding: 0.6rem 0.75rem; }
.card input:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.card details { margin-top: 1.1rem; }
.card summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.9rem; }
.card .notice { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin-bottom: 1rem; font-size: 0.9rem; }
.card .error { border: 1px solid rgba(248, 113, 113, 0.45); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin-bottom: 1rem; color: var(--red); font-size: 0.9rem; }
.card .actions { display: flex; gap: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 0.6rem 1rem;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
}
.btn:hover { background: var(--raised); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { filter: brightness(0.93); background: var(--gold); }

/* ------------------------------------------------------------ MudBlazor adjustments */

/* MudBlazor turns every <button> into a centred flex box. The panel's own plain buttons are ordinary boxes. */
.filters button, .type-option, .file-open, .crumbs button { display: block; }
.type-option { width: 100%; }

.mud-button-root { letter-spacing: 0; }
.mud-dialog { border: 1px solid var(--line); background-image: none; }
.mud-dialog .mud-dialog-title { font-weight: 600; font-size: 1.1rem; }
.mud-input-control { margin-top: 0.35rem; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 2000; padding: 0.75rem 1.5rem; background: var(--red); color: #1c0606; font-weight: 600; }
#blazor-error-ui a { color: inherit; margin-left: 0.75rem; }

/* ------------------------------------------------------------ small screens and motion */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  /* A bar with the logo and the menu button stays at the top; under it, on a server's pages, that server's sections. */
  .topbar { display: block; position: sticky; top: 0; z-index: 1100; background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; }
  .topbar .tabs { border-top: 1px solid var(--line); }
  /* The sidebar waits off screen and slides in as a drawer when html has the class menu-open (set by voxi.js). */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1300;
    width: min(18rem, 86vw);
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    transform: translateX(-100%);
    /* Hidden, not just moved away, so its links cannot be reached with Tab while it is closed. */
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .menu-open .sidebar { transform: none; visibility: visible; transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.7); }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 1290; background: rgba(0, 0, 0, 0.65); }
  .menu-open, .menu-open body { overflow: hidden; }
  .menu-close { display: grid; }
  .nav-link { padding: 0.6rem 0.75rem; }
  .main { padding: 1rem 0.85rem 3rem; }
  /* Wide tables keep their shape and scroll sideways inside their frame instead of squeezing every column. */
  .table.wide { min-width: 44rem; }
  .server-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 0.5rem; }
  .server-row .address, .server-row .memory { display: none; }
  .server-row .status { grid-column: 2; }
  .server-row .power { grid-column: 3; grid-row: 1 / span 2; }
  .file { grid-template-columns: 1.3rem minmax(0, 1fr) auto; }
  .file .when, .file .size { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------ popups raised by the game */

.modal-backdrop { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 1.25rem; background: rgba(0, 0, 0, 0.7); }
.modal { width: 100%; max-width: 30rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1.5rem; }
.modal h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.modal p { color: var(--muted); }
.modal .row { margin-top: 1.25rem; }
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #050506;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.code-box b { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.12em; }

/* ------------------------------------------------------------ content (plugins, mods, modpacks) */

.segments { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.segments button { font: inherit; font-weight: 500; color: var(--muted); background: transparent; border: 0; border-radius: 5px; padding: 0.35rem 0.9rem; cursor: pointer; }
.segments button:hover { color: var(--text); }
.segments button[aria-pressed="true"] { color: var(--text); background: var(--raised); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 0.6rem; }
.section-title p { color: var(--muted); font-size: 0.87rem; }

.content-row { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.9rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.content-row:last-child { border-bottom: 0; }
.content-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-sm); background: var(--raised); object-fit: cover; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.content-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-title span { color: var(--muted); font-weight: 400; font-size: 0.87rem; margin-left: 0.4rem; }
.content-text { color: var(--muted); font-size: 0.87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-actions { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.content-actions .muted { font-size: 0.82rem; }

@media (max-width: 900px) {
  .content-row { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .content-actions { grid-column: 2; }
}

/* ------------------------------------------------------------ chips */

.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
.chip::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.running { color: var(--green); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.chip.busy { color: var(--blue); border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
.chip.busy::before { animation: pulse 1.2s ease-in-out infinite; }
.chip.bad { color: var(--red); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.chip .uptime { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 400; }
/* Asleep: stopped because nobody played, and starting again by itself where the game allows. */
.chip.asleep { color: #a5b4fc; border-color: rgba(165, 180, 252, 0.4); background: rgba(165, 180, 252, 0.08); }
.status.asleep { color: #a5b4fc; }
.status.asleep::before { background: #a5b4fc; }
.players { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.players .mud-icon-root { font-size: 1rem; }
.players.some { color: var(--green); }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.9rem; }
.player-list li { display: flex; justify-content: space-between; gap: 0.75rem; }
.player-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ server overview: stat tiles, console, side rail */

/* Running: four small tiles. Not running: one slim line (state, and the disk, the only thing still measured). */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: var(--space-3); }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.85rem 0.65rem; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.stat-value { position: relative; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value.net { font-size: 0.98rem; line-height: 1.6; }
.stat-value small { font-size: 0.78rem; font-weight: 400; color: var(--muted); margin: 0 0.25rem; }
.stat-label, .stat .bar { position: relative; }
.stat .bar { width: 55%; margin-top: 0.35rem; }
/* The chart sits behind the figures, in the corner they do not use. */
.stat .spark { position: absolute; right: 0; bottom: 0; width: 42%; height: 58%; margin: 0; opacity: 0.5; }
.bar { position: relative; height: 4px; border-radius: 2px; background: var(--raised); margin-top: 0.5rem; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 2px; background: var(--gold); transition: width 0.6s; }
.bar.hot > i { background: var(--red); }
.stats-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin-bottom: var(--space-3); padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 0.9rem; }
.stats-state { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; color: var(--muted); }
.stats-state.asleep { color: #a5b4fc; }
.stats-state.asleep .muted { font-weight: 400; }
.stats-line .mud-icon-root { font-size: 1rem; }
.stats-disk { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-disk .mud-icon-root { color: var(--gold); }
.stats-disk b { font-weight: 600; }
.stats-disk .bar { width: 4.5rem; margin: 0 0 0 0.4rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 0.75rem; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 0.75rem; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.6rem; padding: 0.4rem 0.9rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.9rem; }
.box-body { padding: 0.75rem 0.9rem; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sftp-panel { margin-bottom: 1rem; }
.sftp-details { max-width: 36rem; align-items: center; }
/* The address never breaks in the middle; when the copy button (longer in German) does not fit beside it, it moves below. */
.connect { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.95rem; }
.connect > span { min-width: 0; white-space: nowrap; }
.software { display: flex; align-items: center; gap: 0.75rem; }
.software b { display: block; }
.software span { color: var(--muted); font-size: 0.87rem; }

/* ------------------------------------------------------------ game artwork */

.game-banner { position: relative; overflow: hidden; background: var(--raised); }
.game-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
/* Games without artwork of their own get the house backdrop. */
.game-banner.plain { background: linear-gradient(rgba(9, 9, 11, 0.25), rgba(9, 9, 11, 0.25)), url("img/backdrop.jpg") center / cover no-repeat; }

/* ------------------------------------------------------------ server cards on the start page */

.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); gap: 1rem; }
.server-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.server-card:hover { border-color: rgba(255, 215, 0, 0.55); transform: translateY(-2px); }
.server-card.is-on { border-color: rgba(255, 215, 0, 0.35); }
.server-card:hover .game-banner > img { transform: scale(1.05); }
.server-card-art { display: block; }
.server-card-art .game-banner { height: 9rem; }
.server-card-art .game-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 9, 11, 0.1) 30%, var(--surface) 100%); }
.server-card:not(.is-on) .game-banner > img { filter: saturate(0.55) brightness(0.75); }
.server-card-status { position: absolute; top: 0.75rem; right: 0.75rem; }
.server-card-status .chip { background-color: rgba(9, 9, 11, 0.78); backdrop-filter: blur(6px); }
.server-card-body { position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 0 1.1rem 1rem; margin-top: -1.6rem; }
.server-card-id { display: flex; align-items: flex-end; gap: 0.85rem; min-width: 0; }
.server-card-id .game-badge { box-shadow: 0 0 0 3px var(--surface); }
.server-card-id .server-name { font-size: 1.08rem; }
.server-card-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.meter-label { color: var(--muted); font-size: 0.78rem; }
.meter-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-value small { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.server-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.server-card-foot .row { gap: 0.35rem; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ server page: artwork behind the name */

.server-hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-3); }
.server-hero > .game-banner { position: absolute; inset: 0; }
.server-hero > .game-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9, 9, 11, 0.94) 0%, rgba(9, 9, 11, 0.8) 38%, rgba(9, 9, 11, 0.35) 100%); }
.server-hero-content { position: relative; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; padding: 1.2rem 1.4rem; }
.server-hero h1 { font-size: 1.6rem; overflow-wrap: anywhere; }
.server-hero .sub { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.45rem; }
.server-hero .address, .server-hero .chip { background-color: rgba(9, 9, 11, 0.6); }
.server-hero .mud-button-outlined { background-color: rgba(9, 9, 11, 0.55); }

/* On a phone the header is two rows: the server, then its power buttons, Start with its name and the rest as icons. */
@media (max-width: 600px) {
  .server-hero-content { gap: 0.75rem 0.85rem; padding: 0.9rem; }
  .server-hero .game-badge.xl { width: 3rem; height: 3rem; padding: 0.4rem; }
  .server-hero h1 { font-size: 1.3rem; }
  .server-hero .sub { gap: 0.4rem; margin-top: 0.35rem; }
  .server-hero .power { flex-wrap: nowrap; width: 100%; }
  .server-hero .power > .mud-button-filled { flex: 1; }
  .power .power-secondary { min-width: 2.6rem; padding-inline: 0.65rem; }
  .power .power-secondary .power-label { display: none; }
  .power .power-secondary .mud-button-icon-start { margin: 0; }
  /* The software is in the Software box and under Settings; here it would push the address onto a third line. */
  .server-hero .sub > .chip.plain { display: none; }
}

/* ------------------------------------------------------------ content browser */

.content-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.content-bar .grow { min-width: 14rem; }
.segments button .count { margin-left: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.segments button.locked { opacity: 0.6; }
.content-layout { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 1rem; }
.filters h3 { color: var(--muted); font-weight: 500; font-size: 0.8rem; padding: 0 0.6rem 0.4rem; }
.filters h3:not(:first-child) { margin-top: 1rem; }
.filters button { text-align: left; font: inherit; font-size: 0.9rem; color: var(--muted); background: transparent; border: 0; border-radius: var(--radius-sm); padding: 0.3rem 0.6rem; cursor: pointer; text-transform: capitalize; }
.filters button:hover { color: var(--text); background: var(--surface); }
.filters button[aria-pressed="true"] { color: var(--text); background: var(--raised); }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: 0.75rem; }
.content-card { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.85rem; padding: 0.95rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.content-card .content-icon { width: 3rem; height: 3rem; }
.content-card-text { color: var(--muted); font-size: 0.87rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; margin-top: 0.15rem; }
.content-card-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; color: var(--muted); font-size: 0.8rem; }
.load-more { display: flex; justify-content: center; margin-top: 1rem; }
.switch-hint { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; }
.switch-hint p { color: var(--muted); max-width: 52ch; margin: 0.4rem auto 1.1rem; }

/* ------------------------------------------------------------ software dialog and two-column pages */

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.5rem; margin: 0.4rem 0 1rem; }
.type-option { text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; cursor: pointer; }
.type-option:hover { border-color: var(--line-strong); }
.type-option[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.type-option b { display: block; font-weight: 600; }
.type-option span { color: var(--muted); font-size: 0.82rem; }
/* Panels of different heights flow into two columns without leaving holes. */
/* Cards side by side line up: same top, same height in a row, the same gap across and down. */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: var(--space-4); align-items: stretch; }
.panel-grid .panel { margin: 0; }
.panel-grid .panel + .panel { margin-top: 0; }
.panel-grid .wide { grid-column: 1 / -1; }

@media (max-width: 1250px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
  /* The console no longer has the window to itself here, so it takes a share of the screen's height instead. */
  .terminal { height: clamp(18rem, 55vh, 34rem); }
}
@media (max-width: 900px) {
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }
  .filters h3 { display: none; }
  /* dvh is the height that is really visible on a phone, without the part behind the browser's own bars. */
  .terminal { height: clamp(14rem, 55vh, 30rem); height: clamp(14rem, 55dvh, 30rem); }
  .terminal-search { flex-basis: 9rem; }
  /* Phones zoom the whole page into any field with smaller text than this when it is tapped. */
  .command input, .terminal-search input { font-size: 16px; }
  .server-grid { grid-template-columns: minmax(0, 1fr); }
  .server-hero-content { padding: 1.1rem 1rem; }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .stats-disk { margin-left: auto; }
  .stats-disk-label { display: none; }
  .stat-value.net { white-space: normal; font-size: 0.9rem; line-height: 1.35; }
  .settings-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .settings-nav a { flex: none; padding-inline: 0.75rem; }
}

/* ------------------------------------------------------------ gold, and signs of life */

/* The slanted stroke of the logo, as a marker in front of page titles. */
.page-head h1::before { content: ""; display: inline-block; width: 0.5rem; height: 1.05rem; margin-right: 0.65rem; background: var(--gold); transform: skewX(-20deg); vertical-align: -0.1em; }

.nav-link { transition: color 0.15s, background-color 0.15s; }
.nav-link.active { box-shadow: inset 3px 0 0 var(--gold); }
.nav-link:hover .mud-icon-root { color: var(--gold); }
.nav-server { border-color: rgba(255, 215, 0, 0.3); }

a:hover { text-decoration-color: var(--gold); }
.chip.gold { color: var(--gold); border-color: rgba(255, 215, 0, 0.45); background: rgba(255, 215, 0, 0.07); }
.segments button[aria-pressed="true"] { color: var(--gold); }
.filters button[aria-pressed="true"] { color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }
.tabs a.active { color: var(--gold); }
.command > span { color: var(--gold); font-weight: 600; }
.stat-label .mud-icon-root, .box-head .mud-icon-root { font-size: 1rem; color: var(--gold); margin-right: 0.4rem; vertical-align: -0.18em; }
.stat-value .live { color: var(--gold); }
.card { border-top: 2px solid var(--gold); }
.empty h2::before { content: ""; display: block; width: 2rem; height: 3px; margin: 0 auto 0.9rem; background: var(--gold); transform: skewX(-20deg); }

/* Outlined buttons light up in gold; destructive ones keep their red. */
.mud-button-outlined.mud-button-outlined-default { transition: border-color 0.15s, color 0.15s, background-color 0.15s; }
.mud-button-outlined.mud-button-outlined-default:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }

.stat, .box, .content-card { transition: border-color 0.2s; }
.stat:hover, .content-card:hover { border-color: rgba(255, 215, 0, 0.4); }
.content-card:hover .content-icon { transform: scale(1.06); }
.content-icon { transition: transform 0.2s; }
.type-option { display: flex !important; align-items: center; gap: 0.7rem; transition: border-color 0.15s; }
.type-option > span { min-width: 0; }
.type-option b, .type-option span span { display: block; }

/* A running server breathes: its status dot sends out a ring. */
.chip.running::before { animation: ping 2s ease-out infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%, 100% { box-shadow: 0 0 0 0.45rem rgba(74, 222, 128, 0); }
}

/* ------------------------------------------------------------ start page: a band with the house backdrop */

.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 8.5rem;
  margin-bottom: 1.1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(9, 9, 11, 0.93) 0%, rgba(9, 9, 11, 0.7) 40%, rgba(9, 9, 11, 0.3) 72%, rgba(9, 9, 11, 0.78) 100%), url("img/backdrop.jpg") center 40% / cover no-repeat;
}
.page-hero h1 { font-size: 1.7rem; }
.page-hero h1::before { content: ""; display: inline-block; width: 0.55rem; height: 1.2rem; margin-right: 0.7rem; background: var(--gold); transform: skewX(-20deg); vertical-align: -0.1em; }
.page-hero p { color: var(--muted); margin-top: 0.3rem; }
.page-hero .figures-inline { display: flex; gap: 1.75rem; text-align: right; }
.page-hero .figures-inline b { display: block; font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.page-hero .figures-inline b.gold { color: var(--gold); }
.page-hero .figures-inline span { color: var(--text); opacity: 0.75; font-size: 0.82rem; }
.empty.backdrop { border-style: solid; border-color: var(--line); background: linear-gradient(rgba(9, 9, 11, 0.8), rgba(9, 9, 11, 0.9)), url("img/backdrop.jpg") center / cover no-repeat; padding-block: 4rem; }

/* ------------------------------------------------------------ file manager (Files tab: list, uploads, editor) */

.fm { position: relative; border-radius: var(--radius); }
.fm.fm-dropping { outline: 2px dashed var(--gold); outline-offset: 6px; }
.fm.fm-dropping::after {
  content: "Drop files to upload them here";
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: rgba(9, 9, 11, 0.82);
  color: var(--gold); font-weight: 600;
  pointer-events: none;
}
.fm-toolbar { margin-bottom: 0.8rem; }
.fm-filter { display: flex; align-items: center; gap: 0.35rem; height: 2.25rem; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.fm-filter:focus-within { border-color: var(--line-strong); color: var(--text); }
.fm-filter input { width: 11rem; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; }
.fm-filter .mud-icon-root { font-size: 1.1rem; }
.fm-upload-button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 2.25rem; padding: 0 0.9rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.fm-upload-button:hover { border-color: var(--gold); color: var(--gold); }

.fm-bulk { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; padding: 0.4rem 0.6rem 0.4rem 0.9rem; border: 1px solid rgba(255, 215, 0, 0.35); border-radius: var(--radius-sm); background: var(--surface); }
.fm-bulk strong { margin-right: 0.4rem; font-size: 0.9rem; }
.fm-bulk-gap { flex: 1; }

.fm-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.fm-row { display: grid; grid-template-columns: 1.4rem 1.3rem minmax(0, 1fr) 6rem 9rem 2.4rem; align-items: center; gap: 0.75rem; min-height: 2.6rem; padding: 0.2rem 0.5rem 0.2rem 0.9rem; border-bottom: 1px solid var(--line); }
.fm-row:last-child { border-bottom: 0; }
.fm-row:not(.fm-head):hover { background: var(--raised); }
.fm-row.selected { background: rgba(255, 215, 0, 0.06); }
.fm-row input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--gold); cursor: pointer; }
.fm-row svg { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.fm-row.dir svg { color: var(--gold); }
.fm-row .muted { font-size: 0.85rem; }
.fm-row .file-open:disabled { cursor: default; text-decoration: none; }
.fm-head { min-height: 2.3rem; background: var(--bg); font-size: 0.82rem; color: var(--muted); }
.fm-sort { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.2rem; border: 0; border-radius: 4px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.fm-sort:hover, .fm-sort.active { color: var(--text); }
.fm-sort .mud-icon-root { font-size: 0.95rem; }
.fm-nothing { padding: 1rem; }
.fm-loading { margin-top: 0.6rem; }

.fm-uploads { margin-bottom: 0.9rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); background: var(--surface); }
.fm-uploads-head { margin-bottom: 0.4rem; font-size: 0.9rem; }
.fm-upload { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.fm-upload-line { display: flex; align-items: center; gap: 0.75rem; min-height: 2rem; }
.fm-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.fm-upload-status { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-upload.done .fm-upload-status { color: var(--green); }
.fm-upload.failed .fm-upload-status { color: var(--red); }
.fm-upload-error { color: var(--red); font-size: 0.85rem; }
.fm-upload .bar { margin-top: 0.2rem; }

.fm-editor-head { margin-bottom: 0.8rem; }
.fm-editor-path { gap: 0.6rem; }
.fm-editor { height: min(70vh, 48rem); min-height: 20rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.fm-editor .ace_editor, .fm-editor.ace_editor { background: #050506; }
.fm-editor .ace_gutter, .fm-editor.ace_editor .ace_gutter { background: var(--surface); color: #71717a; }
.fm-editor-hint { margin-top: 0.6rem; }

@media (max-width: 900px) {
  .fm-row { grid-template-columns: 1.4rem 1.3rem minmax(0, 1fr) 2.4rem; }
  .fm-row .size, .fm-row .when { display: none; }
  .fm-filter input { width: 8rem; }
  .fm-editor { height: 60vh; }
}

/* Language choice under the account links and on the sign-in page. */
.language-switch { display: flex; gap: 0.6rem; font-size: 0.8rem; margin-top: 0.6rem; color: var(--muted, #9a9aa3); }
.language-switch.centered { justify-content: center; margin-top: 1.2rem; }
.language-switch a { color: inherit; }
.language-switch span[aria-current] { color: var(--mud-palette-primary, #ffd700); font-weight: 600; }


/* Buttons that are only text (MudBlazor's default) looked like labels, especially in rows of backups and schedules.
   Every one of them gets a quiet outline and background, so it is plainly something to click. */
.mud-button-root.mud-button-text {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  padding-inline: 0.75rem;
}
.mud-button-root.mud-button-text:hover { background: var(--raised); border-color: var(--muted); }
.mud-button-root.mud-button-text.mud-button-text-error { border-color: rgba(248, 113, 113, 0.45); }
.mud-button-root.mud-button-text.mud-disabled { border-color: var(--line); background: transparent; }
/* Icon buttons in table rows and list actions (lock, delete, menus) get the same frame. */
td.actions .mud-icon-button, .row-actions .mud-icon-button, .schedule-actions .mud-icon-button, .actions .mud-icon-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
}
td.actions .mud-icon-button:hover, .row-actions .mud-icon-button:hover, .schedule-actions .mud-icon-button:hover, .actions .mud-icon-button:hover { background: var(--raised); }
td.actions > * + * { margin-left: var(--space-2); }
