:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --surface: #fff; --text: #1d1d1f; --muted: #626267; --line: #e5e5ea;
  --blue: #0066cc; --blue-soft: #eaf3ff; --green: #237747; --green-soft: #eaf5ee;
  --red: #b92525; --red-soft: #fff0ef; --toolbar: rgb(245 245 247 / 84%);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 2.75rem; padding: .65rem 1.25rem; border: 1px solid transparent; border-radius: .7rem; background: var(--blue); color: #fff; font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background-color 150ms, transform 150ms; }
button:active:not(:disabled), .button:active { transform: scale(.97); transition-duration: 80ms; }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: var(--blue-soft); color: var(--blue); }
.quiet { color: var(--muted); background: transparent; }
.danger { background: var(--red); }
.danger-text { color: var(--red); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.toolbar { position: sticky; z-index: 10; top: 0; background: var(--toolbar); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
nav { max-width: 72rem; margin: auto; min-height: 4.5rem; padding: .65rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: var(--text); font-size: .9375rem; font-weight: 650; display: flex; gap: .6rem; align-items: center; letter-spacing: -.015em; }
.brand-mark { width: 1.8rem; height: 1.8rem; border-radius: .55rem; background: var(--text); color: var(--surface); display: grid; place-items: center; font-size: 1.25rem; font-weight: 700; }
.brand-section { color: var(--muted); font-weight: 400; padding-left: .6rem; border-left: 1px solid var(--line); }
main { max-width: 66rem; margin: auto; padding: 3.25rem 2rem 5rem; min-height: calc(100vh - 10rem); }
footer { max-width: 68rem; margin: auto; padding: 1.5rem 2rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .75rem; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; line-height: 1.1; letter-spacing: -.035em; margin: .4rem 0 1rem; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; margin: 0 0 .5rem; }
p { margin: .5rem 0; }
.eyebrow { color: var(--muted); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; margin: 0 0 .75rem; }
.intro { color: var(--muted); font-size: 1.125rem; line-height: 1.6; }
.muted, .caption { color: var(--muted); }
.caption { font-size: .8125rem; line-height: 1.5; }
.page-heading { margin-bottom: 2rem; }
.back-link { display: inline-flex; min-height: 2.75rem; align-items: center; margin-bottom: 1.5rem; font-size: .9375rem; }
.surface { background: var(--surface); border-radius: 1.25rem; box-shadow: 0 2px 12px rgb(0 0 0 / 3%); border: 1px solid var(--line); }
.welcome { text-align: center; padding: 1.25rem 0 3.75rem; max-width: 40rem; margin: auto; }
.welcome h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.035em; }
.welcome .intro { margin: 1.4rem 0 1.75rem; }
.login-button { margin: .25rem 0 .85rem; padding-inline: 1.5rem; }
.feature-symbol { color: var(--blue); font-size: 1.8rem; line-height: 1; }
.server-row { color: var(--text); display: flex; align-items: center; gap: 1.15rem; padding: 1.35rem 1.5rem; transition: background-color 150ms; min-width: 0; }
.server-row + .server-row { border-top: 1px solid var(--line); }
.server-row:first-child { border-radius: 1.25rem 1.25rem 0 0; }
.server-row:last-child { border-radius: 0 0 1.25rem 1.25rem; }
.server-row:only-child { border-radius: 1.25rem; }
.game-icon { width: 3rem; height: 3rem; flex-shrink: 0; border-radius: .8rem; display: grid; place-items: center; font-size: 1.25rem; font-weight: 650; color: var(--blue); background: var(--blue-soft); }
.game-icon.zomboid { color: #476244; background: #edf2e9; }
.game-icon.satisfactory { color: #875925; background: #f8efdf; }
.game-icon.factorio { color: #875440; background: #f6eae5; }
.server-name { flex: 1; min-width: 0; }
.server-name strong { display: block; font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }
.server-name > span { display: block; color: var(--muted); font-size: .8125rem; margin-top: .2rem; }
.chevron { font-size: 1.5rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 2rem; padding: .3rem .7rem; background: var(--bg); color: var(--muted); font-size: .75rem; font-weight: 550; white-space: nowrap; }
.badge[data-state="ready"] { color: var(--green); background: var(--green-soft); }
.badge[data-state="failed"], .badge[data-state="interrupted"] { color: var(--red); background: var(--red-soft); }
.badge[data-state="queued"], .badge[data-state="running"] { color: var(--blue); background: var(--blue-soft); }
.collection-note { margin: 1.25rem .25rem; }
.empty-state { text-align: center; padding: 4rem 1.5rem; }
.empty-state h2 { margin-top: 1rem; }
.empty-state p { color: var(--muted); }
.overview-main { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.75rem; }
.live-heading { display: flex; align-items: center; gap: .7rem; font-size: 1.65rem; }
.status-dot { width: .65rem; height: .65rem; flex-shrink: 0; border-radius: 50%; background: var(--muted); }
.status-dot[data-state="running"] { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-dot[data-state="busy"] { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-dot[data-state="failed"] { background: var(--red); }
.controls { display: flex; gap: .5rem; flex-shrink: 0; }
.connection-row { border-top: 1px solid var(--line); padding: 1.15rem 1.75rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.connection-row code { display: block; margin-top: .25rem; overflow-wrap: anywhere; }
.notice { min-height: 1.5rem; color: var(--blue); font-size: .9375rem; margin: 1rem 0 .25rem; }
.notice[data-error="true"] { color: var(--red); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; }
.log-section { margin: 2.5rem 0 1.5rem; }
.log-window { border: 1px solid #33363c; border-radius: 1rem; overflow: hidden; background: #16181d; color: #e0e4ed; }
.log-toolbar { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1.25rem; font-size: .75rem; color: #acb2bf; background: #202329; border-bottom: 1px solid #33363c; }
pre, code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8125rem; }
pre { margin: 0; padding: 1.25rem; height: 23rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
dialog { width: min(25rem, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 1.4rem; background: var(--surface); color: var(--text); padding: 2rem; box-shadow: 0 24px 80px rgb(0 0 0 / 20%); }
dialog::backdrop { background: rgb(0 0 0 / 30%); backdrop-filter: blur(4px); }
dialog h2 { margin-top: 1rem; font-size: 1.4rem; }
dialog p { color: var(--muted); font-size: .9375rem; }
.dialog-icon { font-size: 1.75rem; color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.75rem; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .75rem; background: var(--surface); border-radius: .5rem; }
.skip-link:focus { top: .75rem; }
@media (hover: hover) { .server-row:hover, .quiet:hover { background: var(--blue-soft); } button:hover:not(:disabled), .button:hover { filter: brightness(.95); } }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141416; --surface: #202023; --text: #f5f5f7; --muted: #ababaf; --line: #38383d; --blue: #78b6ff; --blue-soft: #253447; --green: #81d49d; --green-soft: #253b2d; --red: #ff9292; --red-soft: #442929; --toolbar: rgb(20 20 22 / 86%); }
  button, .button { background: #1264c5; color: #fff; }
  .secondary { background: var(--blue-soft); color: var(--blue); }
  .quiet { background: transparent; color: var(--muted); }
  .danger { background: #a42525; color: #fff; }
  .danger-text { color: var(--red); }
  .game-icon.zomboid { color: #b1cda7; background: #2b3529; }
  .game-icon.satisfactory { color: #e1bb87; background: #3a3124; }
  .game-icon.factorio { color: #dfb39e; background: #3d2e27; }
}
@media (max-width: 640px) {
  nav { padding-inline: 1.15rem; } .brand-section { display: none; }
  main { padding: 2rem 1.15rem 3rem; } footer { padding-inline: 1.15rem; flex-direction: column; gap: .35rem; }
  .welcome { padding-top: 1rem; padding-bottom: 2.5rem; }
  .server-row { padding: 1.15rem 1rem; gap: .8rem; flex-wrap: wrap; }
  .server-row .badge { margin-left: 3.8rem; margin-top: -.3rem; }
  .server-name { flex-basis: calc(100% - 4rem); } .chevron { margin-left: auto; }
  .overview-main { display: block; padding: 1.4rem; }
  .controls { margin-top: 1.4rem; flex-wrap: wrap; } .controls button { flex: 1; }
  .connection-row { padding: 1rem 1.4rem; flex-wrap: wrap; }
  .connection-row button { padding-left: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } button:active:not(:disabled), .button:active { transform: none; } }
@media (prefers-reduced-transparency: reduce) { .toolbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } dialog::backdrop { backdrop-filter: none; background: rgb(0 0 0 / 55%); } }
@media (prefers-contrast: more) { :root { --muted: var(--text); --line: var(--text); } .toolbar { background: var(--bg); backdrop-filter: none; } .surface, button, .button { border-color: currentColor; } }
