/* Material Design 3: blue tonal dark theme. No external dependencies. */
@font-face { font-family: Manrope; src: url('/assets/manrope.ttf') format('truetype'); font-weight: 400; font-display: swap; }
:root {
  color-scheme: dark;
  --md-sys-color-primary: #adc6ff;
  --md-sys-color-on-primary: #102f60;
  --md-sys-color-primary-container: #294777;
  --md-sys-color-on-primary-container: #d8e2ff;
  --md-sys-color-secondary-container: #3e4759;
  --md-sys-color-on-secondary-container: #dce2f9;
  --md-sys-color-surface: #111318;
  --md-sys-color-surface-container-low: #191c22;
  --md-sys-color-surface-container: #1d2026;
  --md-sys-color-surface-container-high: #282a31;
  --md-sys-color-surface-container-highest: #33353c;
  --md-sys-color-on-surface: #e2e2e9;
  --md-sys-color-on-surface-variant: #c3c6d0;
  --md-sys-color-outline: #8d919b;
  --md-sys-color-outline-variant: #434751;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #65352f;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-tertiary-container: #244e41;
  --md-sys-color-on-tertiary-container: #b8f0d9;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-motion-easing-standard: cubic-bezier(.2, 0, 0, 1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font: 400 14px/1.5 Manrope, system-ui, sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
h1, h2, p { margin: 0; }
p { color: var(--md-sys-color-on-surface-variant); }
.hidden { display: none !important; }
.shell { max-width: 1200px; margin: auto; padding: 0 40px 32px; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; font-size: 22px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font: 36px/1 Georgia, serif; padding-bottom: 5px; }
.brand-divider { padding: 0 12px; color: var(--md-sys-color-outline); }
.brand-room { font-size: 14px; color: var(--md-sys-color-on-surface-variant); }
.header-right { display: flex; align-items: center; gap: 16px; }
.private { padding: 6px 12px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 28px 0; }
.page-heading h1 { font-size: 36px; line-height: 44px; font-weight: 400; letter-spacing: -.5px; }
.page-heading p { margin-top: 6px; }
.connection { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 100px; background: var(--md-sys-color-surface-container); }
.connection-indicator { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--md-sys-color-outline); }
.connection-indicator.connected { background: var(--md-sys-color-on-tertiary-container); }
.refresh { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
button { position: relative; min-height: 48px; border-radius: 100px; padding: 0 24px; border: 0; cursor: pointer; font-size: 14px; font-weight: 600; letter-spacing: .1px; transition: background-color 180ms var(--md-sys-motion-easing-standard), box-shadow 180ms var(--md-sys-motion-easing-standard); isolation: isolate; }
button::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; pointer-events: none; transition: opacity 180ms; }
button:hover::after { opacity: .08; }
button:active::after { opacity: .12; }
button:disabled { opacity: .38; cursor: not-allowed; }
button:disabled::after { opacity: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--md-sys-color-primary); outline-offset: 4px; }
.primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.quiet { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }
#logout { border: 0; padding: 0 20px; }

.server-stack { display: flex; flex-direction: column; gap: 24px; }
.address-settings { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.address-settings > .metric-label { margin: 0; }
.address-toggle { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: 100px; overflow: hidden; max-width: 100%; }
.address-toggle button { border-radius: 0; padding: 0 20px; background: transparent; color: var(--md-sys-color-on-surface-variant); }
.address-toggle button[aria-pressed="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.address-toggle button:focus-visible { outline-offset: -4px; }
.world-badges { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.status-address { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.address-badge { display: flex; align-items: center; min-width: 0; background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); border-radius: 8px; padding-left: 10px; }
.address-badge code { font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.copy-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; background: transparent; color: var(--md-sys-color-primary); }
.copy-check { display: none; }
.copy-icon[data-copied="true"] .copy-outline { display: none; }
.copy-icon[data-copied="true"] .copy-check { display: block; }
.world { border-radius: var(--md-sys-shape-corner-extra-large); overflow: hidden; background: var(--md-sys-color-surface-container-high); box-shadow: 0 8px 26px #0003; }
.world-art { position: relative; height: 316px; background: var(--md-sys-color-primary-container); }
.world-art:not(.has-game-art)::before { content: 'μ'; position: absolute; right: 36px; bottom: -32px; font: 280px/1 Georgia, serif; color: var(--md-sys-color-on-primary-container); opacity: .07; }
.world-art.has-game-art { background: linear-gradient(0deg, #101620bb, #10162008 70%), var(--game-art) center 42%/cover; }
.world[data-server-id="vrising"] { --game-art: url('/assets/vrising.jpg'); }
.world[data-server-id="scpsl"] { --game-art: url('/assets/scpsl.jpg'); }
.world[data-server-id="valheim"] { --game-art: url('/assets/valheim.jpg'); }
.world[data-server-id="palworld"] { --game-art: url('/assets/palworld.jpg'); }
.world[data-server-id="terraria"] { --game-art: url('/assets/terraria.jpg'); }
.status-badge, .players-badge { padding: 6px 12px; min-height: 32px; display: flex; align-items: center; border-radius: 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.status-badge { left: 28px; background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.status-badge.offline { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); }
.players-badge { right: 28px; background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.world-title { position: absolute; left: 28px; right: 28px; bottom: 72px; text-shadow: 0 2px 14px #0007; }
.world-title h2 { font-size: 32px; line-height: 40px; font-weight: 400; overflow-wrap: anywhere; }
.world-art:not(.has-game-art) .world-title { color: var(--md-sys-color-on-primary-container); }
.metric-label { display: block; color: var(--md-sys-color-on-surface-variant); font-size: 12px; letter-spacing: .4px; margin-bottom: 8px; }
.server-action { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.server-action button { white-space: nowrap; }
.world.config-open .server-action { display: none; }
.status-labels { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; max-width: 100%; }
.idle-policy { font-size: 12px; color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-high); padding: 6px 10px; border-radius: 8px; }
.load-panel { margin-top: 32px; padding: 28px; background: var(--md-sys-color-surface-container-low); border-radius: var(--md-sys-shape-corner-extra-large); }
.load-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.load-heading h2, .activity h2 { font-size: 22px; line-height: 28px; font-weight: 400; }
.host-load { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 28px; }
.host-load > div { padding: 20px; background: var(--md-sys-color-surface-container-high); border-radius: var(--md-sys-shape-corner-large); }
.host-load strong { font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.load-table-wrap { overflow-x: auto; }
.load-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; font-variant-numeric: tabular-nums; }
.load-table caption { text-align: left; font-size: 14px; color: var(--md-sys-color-on-surface); padding-bottom: 12px; }
.load-table th { font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); }
.load-table th, .load-table td { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.load-table td:first-child { overflow-wrap: anywhere; }
.load-note { font-size: 12px; margin-top: 16px; }
.activity { margin: 32px 0 0; padding: 0 8px; }
.activity h2 { margin-bottom: 16px; }
.empty-activity { font-size: 13px; }
.activity-row { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); font-size: 13px; }
.activity-row time { flex-shrink: 0; color: var(--md-sys-color-on-surface-variant); }
.banner { padding: 16px 20px; border-radius: var(--md-sys-shape-corner-large); margin-bottom: 20px; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.error { color: var(--md-sys-color-error); font-size: 14px; }
.error.banner { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.login { display: grid; grid-template-columns: 1fr 1fr; margin: 56px auto; border-radius: var(--md-sys-shape-corner-extra-large); overflow: hidden; background: var(--md-sys-color-surface-container); max-width: 960px; }
.login-art { min-height: 440px; background: linear-gradient(0deg, #11131880, #11131810), url('/assets/vrising.jpg') 48% center/cover; }
.login-panel { padding: 48px; align-self: center; }
.login-panel h1 { font-size: 32px; line-height: 40px; font-weight: 400; margin-bottom: 8px; }
.login-panel > p { margin-bottom: 32px; }
#login-form { display: flex; flex-direction: column; gap: 16px; }
#login-form label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
input { width: 100%; min-height: 56px; padding: 16px; color: var(--md-sys-color-on-surface); background: var(--md-sys-color-surface-container-high); border: 1px solid var(--md-sys-color-outline); border-radius: 4px; }
input::placeholder { color: var(--md-sys-color-on-surface-variant); }
#login-error:empty { display: none; }
dialog { width: 460px; max-width: calc(100% - 32px); padding: 28px; border: 0; border-radius: var(--md-sys-shape-corner-extra-large); color: var(--md-sys-color-on-surface); background: var(--md-sys-color-surface-container-high); box-shadow: 0 24px 48px #0006; }
dialog::backdrop { background: #0009; }
dialog h2 { font-size: 24px; line-height: 32px; font-weight: 400; margin-bottom: 16px; }
dialog p { font-size: 14px; line-height: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.dialog-actions .quiet { border: 0; padding: 0 16px; }
#confirm-stop { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
button.loading { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.action-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: action-spin .75s linear infinite; }
@keyframes action-spin { to { transform: rotate(360deg); } }
/* Game settings: same-size text layers keep syntax and caret aligned. */
.config-section { display: contents; }
.config-bar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; min-height: 40px; padding: 4px 12px; background: rgba(37, 42, 53, .65); backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%); border-top: 1px solid rgba(225, 234, 255, .15); }
.config-bar button { min-height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--md-sys-color-primary); font-size: 12px; font-weight: 500; white-space: nowrap; }
.config-bar .start { background: #244e414d; color: var(--md-sys-color-on-tertiary-container); }
.config-bar .stop { background: #784a472e; color: var(--md-sys-color-on-error-container); }
.config-bar [data-config="save-restart"] { background: #784a472e; color: var(--md-sys-color-on-error-container); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .config-bar { background: #303640ef; } }
.config-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 8px; border-radius: 100px; background: transparent; color: var(--md-sys-color-primary); text-align: left; }
.config-toggle svg { flex-shrink: 0; transition: transform 180ms; }
.config-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.config-panel { padding: 0; min-width: 0; height: auto; interpolate-size: allow-keywords; overflow: clip; opacity: 1; transition: height 180ms var(--md-sys-motion-easing-standard), opacity 180ms, display 180ms allow-discrete; }
.config-panel.hidden { height: 0; opacity: 0; }
@starting-style { .config-panel:not(.hidden) { height: 0; opacity: 0; } }
.config-code { position: relative; height: 320px; max-height: 55vh; min-height: 160px; overflow: hidden; border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); border-radius: 0; background: var(--md-sys-color-surface-container-high); }
.config-code pre, .config-code textarea { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 16px; border: 0; border-radius: 0; font: 14px/22px ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-ligatures: none; letter-spacing: 0; tab-size: 2; white-space: pre; overflow-wrap: normal; word-break: normal; }
.config-code pre { overflow: hidden; pointer-events: none; color: var(--md-sys-color-on-surface); }
.config-code textarea { resize: none; overflow: auto; background: transparent; color: transparent; caret-color: var(--md-sys-color-on-surface); -webkit-text-fill-color: transparent; }
.config-code textarea::selection { background: #adc6ff55; }
.config-code:focus-within { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.config-code textarea:focus { outline: none; }
.json-key { color: #adc6ff; }
.json-string { color: #b8f0d9; }
.json-number { color: #ffd5a6; }
.json-literal { color: #e6bcff; }
.config-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-left: auto; }
.config-message { font-size: 13px; }
.config-panel .error, .config-message { overflow-wrap: anywhere; }
.config-panel .error:empty, .config-message:empty { display: none; }
.config-panel .error:not(:empty), .config-message:not(:empty) { padding: 8px 20px; }
@media (max-width: 600px) {
  .config-bar { padding: 4px 12px; }
  .config-actions { width: 100%; }
  .config-actions button { padding: 0 9px; font-size: 11px; }
}
@media (forced-colors: active) {
  .config-code pre { visibility: hidden; }
  .config-code textarea { color: CanvasText; -webkit-text-fill-color: CanvasText; caret-color: CanvasText; }
}
@media (max-width: 900px) {
  .shell { padding: 0 24px 24px; }

  .login-panel { padding: 32px; }
}
@media (max-width: 600px) {
  .address-settings { align-items: flex-start; flex-direction: column; }
  .address-toggle { width: 100%; }
  .address-toggle button { flex: 1; padding: 0 12px; font-size: 12px; }
  .world-badges { top: 20px; left: 20px; right: 20px; }
  .status-address { width: 100%; }
  .status-labels { width: 100%; }
  .address-badge { flex: 1; }
  .shell { padding: 0 16px 24px; }
  .site-header { height: 80px; }
  .brand-room, .brand-divider { display: none; }
  .brand { gap: 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin: 20px 0 24px; }
  .page-heading h1 { font-size: 28px; line-height: 36px; }
  .world-art { height: 310px; }
  .status-badge { top: 20px; left: 20px; }
  .players-badge { top: 20px; right: 20px; font-size: 11px; }
  .world-title { left: 20px; right: 20px; bottom: 100px; }
  .world-title h2 { font-size: 28px; line-height: 36px; }
  .config-bar { padding: 4px 8px; }
  .config-bar button { padding: 0 9px; font-size: 11px; }
  .load-panel { padding: 20px; margin-top: 24px; }
  .load-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .host-load { grid-template-columns: 1fr; }
  .host-load strong { font-size: 20px; }
  .load-table { min-width: 420px; }
  .login { grid-template-columns: 1fr; margin: 24px auto; }
  .login-art { min-height: 200px; }
  .login-panel { padding: 28px 24px; }
  .dialog-actions { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .status-badge, .players-badge { padding: 6px 8px; }
  .players-badge { max-width: 136px; }

}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
