/* The gaming terminal's Windows 95/98 look, after MegaMud 1.03s. Sizes in dialogs come from the
   original layouts in dialog units (megamud.js converts them: 1.5px across, 1.625px down). */
:root {
	--face: #c0c0c0; --light: #ffffff; --hilite: #dfdfdf; --shadow: #808080; --dark: #000000;
	--title: #000080; --title2: #1084d0; --title-off: #808080; --title-off2: #b5b5b5;
	--select: #000080; --win: #ffffff; --text: #000000; --gray-text: #808080;
	--ui-font: 11px "MS Sans Serif", "Microsoft Sans Serif", Tahoma, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #008080; overflow: hidden; }
body { font: var(--ui-font); color: var(--text); user-select: none; -webkit-user-select: none; }

/* 3D edges, as Windows drew them */
.raised { border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite); }
.sunken { border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hilite); }
.thin-sunken { border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
.thin-raised { border: 1px solid; border-color: var(--light) var(--shadow) var(--shadow) var(--light); }
.etched { border: 1px solid var(--shadow); box-shadow: 1px 1px var(--light), inset 1px 1px var(--light); }

/* ---- the main window ---- */
.app { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--face); padding: 3px; }
.titlebar { display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 2px 0 3px; color: #fff; font-weight: bold;
	background: linear-gradient(90deg, var(--title), var(--title2)); flex: none; }
.titlebar.off { background: linear-gradient(90deg, var(--title-off), var(--title-off2)); color: var(--face); }
.titlebar img { width: 16px; height: 16px; image-rendering: pixelated; }
.titlebar .caption { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar a.switch { color: #fff; font-weight: normal; text-decoration: underline; margin-right: 6px; white-space: nowrap; }
.capbtn { width: 16px; height: 14px; padding: 0; background: var(--face); font: bold 9px/10px Arial, sans-serif; color: #000; display: flex;
	align-items: center; justify-content: center; }
.capbtn:active { border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow); }
.capbtn + .capbtn.close { margin-left: 2px; }

.menubar { display: flex; height: 19px; flex: none; position: relative; z-index: 50; }
.menubar > .top { padding: 2px 6px 0; height: 18px; cursor: default; }
.menubar > .top.open { border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 1px 5px 0; }
.menubar > .top:hover:not(.open) { border: 1px solid; border-color: var(--light) var(--shadow) var(--shadow) var(--light); padding: 1px 5px 0; }
u { text-decoration: underline; }

.menu { position: absolute; background: var(--face); padding: 2px; min-width: 150px; z-index: 60; box-shadow: 1px 1px 0 #0004; }
.menu .item { display: flex; align-items: center; height: 17px; padding: 0 16px 0 18px; white-space: nowrap; position: relative; cursor: default; }
.menu .item .acc { margin-left: auto; padding-left: 24px; }
.menu .item.hot { background: var(--select); color: #fff; }
.menu .item.checked::before { content: "\2713"; position: absolute; left: 5px; font-weight: bold; }
.menu .item.sub::after { content: "\25B6"; position: absolute; right: 4px; font-size: 7px; }
.menu .item.disabled { color: var(--gray-text); text-shadow: 1px 1px var(--light); }
.menu .item.disabled.hot { color: var(--shadow); text-shadow: none; }
.menu .sep { height: 2px; margin: 3px 1px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 2px 2px; flex: none;
	border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); box-shadow: inset 0 1px var(--light), 0 1px var(--shadow); margin-bottom: 2px; }
.toolbar .tb { width: 23px; height: 22px; padding: 2px 3px; border: 1px solid transparent; background: none; }
.toolbar .tb span { display: block; width: 16px; height: 16px; background-image: url("toolbar.bmp"); background-repeat: no-repeat; image-rendering: pixelated; }
.toolbar .tb:hover:not(:disabled) { border-color: var(--light) var(--shadow) var(--shadow) var(--light); }
.toolbar .tb:active:not(:disabled), .toolbar .tb.down { border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 3px 2px 1px 4px; }
.toolbar .tb.down { background: repeating-conic-gradient(var(--face) 0 25%, var(--light) 0 50%) 0 0 / 2px 2px; }
.toolbar .tb:disabled span { filter: grayscale(1) contrast(.4) brightness(1.3); }
.toolbar .tbsep { width: 2px; height: 20px; margin: 0 3px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--light); }

.client { flex: 1; position: relative; overflow: hidden; background: var(--shadow); min-height: 0; }
.client rworld-terminal { position: absolute; left: 0; top: 0; }
.client .term-frame { position: absolute; left: 0; top: 0; padding: 0; }

.statusbar { display: flex; gap: 2px; height: 20px; padding-top: 2px; flex: none; }
.statusbar .pane { padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 18px; line-height: 15px; }
.statusbar .pane.main { flex: 1; }
.statusbar .pane.hp b, .statusbar .pane.ma b { font-weight: normal; }
.statusbar .pane.low { color: #c00000; }
.statusbar .grip { width: 14px; background: linear-gradient(135deg, transparent 50%, var(--shadow) 50% 58%, var(--light) 58% 66%, transparent 66% 74%, var(--shadow) 74% 82%, var(--light) 82% 90%, transparent 90%); }

/* ---- windows (tool windows and dialogs) ---- */
.win { position: absolute; background: var(--face); padding: 3px; z-index: 20; }
.win.tool .titlebar { height: 16px; font-size: 11px; }
.win .body { position: relative; }
.win.modal { z-index: 40; }
.overlay { position: absolute; inset: 0; z-index: 39; }
.win .titlebar { cursor: default; }

/* ---- controls ---- */
.dlg { position: relative; font: var(--ui-font); }
.dlg > * { position: absolute; }
.dlg .lbl { white-space: pre-line; overflow: hidden; line-height: 13px; }
.dlg .lbl.center { text-align: center; }
.dlg .lbl.right { text-align: right; }
.dlg .lbl.value { color: #000; }
.dlg .panel { border: 1px solid; border-color: var(--light) var(--shadow) var(--shadow) var(--light); }
.dlg .panel.sunk, .dlg .lbl.sunk { border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding-left: 2px; }
.dlg .frame-black { border: 1px solid #000; } .dlg .frame-gray { border: 1px solid var(--shadow); } .dlg .frame-white { border: 1px solid #fff; }
.dlg .rect-black { background: #000; } .dlg .rect-gray { background: var(--shadow); } .dlg .rect-white { background: #fff; }
.dlg .etch-h { border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); height: 2px !important; }
.dlg .etch-frame { border: 1px solid var(--shadow); box-shadow: 1px 1px var(--light), inset 1px 1px var(--light); }
.dlg .pic { image-rendering: pixelated; object-fit: none; object-position: left top; }
.dlg .group { border: 1px solid var(--shadow); box-shadow: 1px 1px var(--light), inset 1px 1px var(--light); }
.dlg .group > .gl { position: absolute; top: -8px; left: 7px; padding: 0 2px; background: var(--face); white-space: nowrap; line-height: 13px; }
button.push { font: var(--ui-font); color: #000; background: var(--face); padding: 0;
	border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite); }
button.push.def { outline: 1px solid #000; outline-offset: -1px; border-width: 2px; }
button.push:active:not(:disabled) { border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow); padding: 1px 0 0 1px; }
button.push:disabled { color: var(--gray-text); text-shadow: 1px 1px var(--light); }
button.push.mini { font-size: 8px; line-height: 4px; }
button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.dlg label.check { display: flex; align-items: center; gap: 4px; white-space: nowrap; line-height: 13px; }
.dlg label.check input { margin: 0; width: 13px; height: 13px; flex: none; accent-color: #000; }
.dlg .group label.check { position: static; }
.field { background: var(--win); font: var(--ui-font); color: #000; outline: none; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hilite); padding: 2px 3px; }
textarea.field { resize: none; }
.field:disabled { background: var(--face); color: var(--gray-text); }
.combo { display: flex; background: var(--win); height: 21px;
	border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hilite); padding: 2px; }
.combo select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: var(--ui-font); padding: 0 1px; outline: none; }
.combo .drop { width: 16px; flex: none; background: var(--face); display: flex; align-items: center; justify-content: center;
	border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite); pointer-events: none; }
.list { background: var(--win); overflow: auto;
	border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hilite); padding: 2px; }
.list .row { padding: 0 2px; height: 14px; line-height: 14px; white-space: nowrap; }
.list .row.sel { background: var(--select); color: #fff; }
.list .muted { color: var(--gray-text); padding: 2px; white-space: normal; }
.listview { display: flex; flex-direction: column; padding: 2px; }
.listview .hdr { display: flex; flex: none; }
.listview .hdr span { padding: 1px 4px; height: 17px; white-space: nowrap; overflow: hidden; background: var(--face);
	border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow); }
.listview .rows { flex: 1; overflow: auto; }
.listview .rows .row { display: flex; }
.listview .rows .row span { padding: 0 4px; white-space: nowrap; overflow: hidden; }
.listview .rows .row.known { font-weight: bold; }
.updown { display: flex; flex-direction: column; }
.updown span { flex: 1; background: var(--face); display: flex; align-items: center; justify-content: center;
	border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow); }
.unknown { border: 1px dashed var(--shadow); color: var(--gray-text); font-size: 9px; padding: 1px; overflow: hidden; }
.disabled-ctl { color: var(--gray-text); }

/* property sheets */
.sheet { padding: 6px 6px 0; }
.tabs { display: flex; flex-wrap: wrap-reverse; position: relative; z-index: 1; margin-bottom: -1px; padding-left: 2px; }
.tab { flex: 1 0 auto; text-align: center; padding: 2px 6px 3px; margin-top: 2px; background: var(--face); position: relative; cursor: default; white-space: nowrap;
	border: 1px solid; border-bottom: 0; border-color: var(--light) var(--dark) transparent var(--light); border-radius: 3px 3px 0 0;
	box-shadow: inset -1px 0 var(--shadow); }
.tab.on { margin-top: 0; padding: 3px 8px 5px; margin-left: -2px; margin-right: -2px; z-index: 2; }
.page { border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light); box-shadow: inset -1px -1px var(--shadow); padding: 0; position: relative; }
.sheet .buttons, .win .buttons { display: flex; justify-content: flex-end; gap: 6px; padding: 7px 0 6px; }
.sheet .buttons button, .win .buttons button { width: 75px; height: 23px; position: static; }

/* the compass on Quick Tools */
.compass { cursor: pointer; }
.compass.pressed { content: url("compass-down.bmp"); }

/* conversations window */
.convo-say { position: absolute; left: 0; right: 0; top: 0; height: 22px; display: flex; gap: 4px; margin: 0; }
.convo-say input { flex: 1; min-width: 0; font: 12px "Courier New", monospace; }
.convo-say button { width: 44px; }
.convo { position: absolute; inset: 26px 0 0 0; font: 12px "Courier New", monospace; user-select: text; -webkit-user-select: text; }
.convo .row { height: auto; white-space: pre-wrap; line-height: 14px; }
.toast { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 80; background: #ffffe1; border: 1px solid #000; padding: 3px 8px; pointer-events: none; }

/* the little black arrows on combo boxes and spinners */
.combo .drop::before, .updown .dn::before { content: ""; border: 4px solid transparent; border-top: 4px solid #000; border-bottom: 0; }
.updown .up::before { content: ""; border: 3px solid transparent; border-bottom: 3px solid #000; border-top: 0; }
.updown .dn::before { border-width: 3px 3px 0; }

/* the lists MegaMud filled in code (Cash currencies, Other options, mode defaults) */
.list .lrow { display: flex; align-items: center; gap: 4px; height: 17px; }
.list .lrow label.check { position: static; }
.list .lrow .lname { flex: 1; white-space: nowrap; }
.list .lrow .lchoice { font: var(--ui-font); height: 16px; padding: 0; border: 1px solid var(--shadow); background: var(--win); }
.combo input { flex: 1; min-width: 0; border: 0; background: transparent; font: var(--ui-font); padding: 0 1px; outline: none; }
.combo input::-webkit-calendar-picker-indicator { display: none !important; }

/* Goto's tree, and How? */
.list.tree .row { cursor: default; }
.list.tree .group::before { content: '+'; display: inline-block; width: 9px; height: 9px; line-height: 8px; margin-right: 4px;
  border: 1px solid var(--shadow); text-align: center; font-size: 9px; }
.list.tree .group.open::before { content: '-'; }
.list.tree .leaf.in { padding-left: 17px; }
.how-box { padding: 8px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.how { font-family: monospace; white-space: pre; max-height: 50vh; overflow: auto; background: var(--win);
  border: 1px solid var(--shadow); padding: 4px; align-self: stretch; }

/* Game Data: the detail dialogs' Other Info lines (label, value), and the lists' column headings. */
.list .row.info { display: flex; gap: 4px; }
.list .row.info .k { flex: 0 0 74px; color: var(--gray-text); }
.listview .hdr span { cursor: default; }

/* Back-scroll: the match Find selected, plain to see on black. */
.backscroll::selection { background: #ffff55; color: #000; }
