@font-face { font-family: "Pixelated MS Sans Serif"; src: url("fonts/ms_sans_serif.woff2") format("woff2"); font-weight: normal; }
@font-face { font-family: "Pixelated MS Sans Serif"; src: url("fonts/ms_sans_serif_bold.woff2") format("woff2"); font-weight: bold; }

:root { --bg: #008080; --panel: #c0c0c0; --text: #000;
  --hi: #fff; --light: #dfdfdf; --lo: #808080; --dark: #000; --sel: #000080; --sel-text: #fff;
  --tip: #ffffe1; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 11px/1.4 "Pixelated MS Sans Serif", "MS Sans Serif", Tahoma, sans-serif;
  -webkit-font-smoothing: none; }

header { background: var(--panel); border-bottom: 1px solid var(--dark); user-select: none; }

/* Menu bar */
.menubar { display: flex; align-items: center; padding: 1px 4px; position: relative;
  border-bottom: 1px solid var(--lo); }
.menu { position: relative; }
.menu > button { font: inherit; background: none; border: 1px solid transparent; padding: 2px 7px; color: inherit; }
.menu.open > button { border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
.menu > button:focus-visible { outline: 1px dotted var(--dark); outline-offset: -3px; }
.dropdown { display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 200px;
  background: var(--panel); padding: 2px;
  border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--lo), inset 1px 1px var(--hi); }
.menu.open .dropdown { display: block; }
.dropdown button { position: relative; display: flex; justify-content: space-between; gap: 24px; width: 100%;
  font: inherit; text-align: left; background: none; border: 0; padding: 3px 20px; color: inherit; }
.dropdown button:hover:not(:disabled), .dropdown button:focus-visible { background: var(--sel); color: var(--sel-text); outline: none; }
.dropdown button:disabled { color: var(--lo); text-shadow: 1px 1px var(--hi); }
.dropdown button[aria-checked="true"]::before { content: "✓"; position: absolute; left: 6px; }
.dropdown button[role="menuitemradio"][aria-checked="true"]::before { content: "●"; font-size: 8px; left: 7px; top: 5px; }
.dropdown hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid var(--hi); margin: 3px 1px; }
.dropdown .hint { color: var(--lo); }
.dropdown button:hover .hint { color: inherit; }
.notes { margin-left: auto; padding-right: 8px; display: flex; gap: 12px; color: #800000; }
.rec { color: #c00; font-weight: bold; }

/* Toolbar: Win95 raised icon buttons */
.toolbar { display: flex; align-items: center; justify-content: center; gap: 2px; padding: 3px 8px;
  flex-wrap: wrap; border-top: 1px solid var(--hi); }
.tool, .tbtn { font: inherit; color: inherit; background: var(--panel); cursor: default;
  border: 1px solid; border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  box-shadow: inset -1px -1px var(--lo), inset 1px 1px var(--light); }
.tool { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }
.tool img { display: block; image-rendering: pixelated; pointer-events: none; }
.tbtn { padding: 4px 12px; }
.tool:active, .tool[aria-pressed="true"], .tbtn:active {
  border-color: var(--dark) var(--hi) var(--hi) var(--dark);
  box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--light); }
.tool:active img, .tool[aria-pressed="true"] img { transform: translate(1px, 1px); }
.tool[aria-pressed="true"] { background: repeating-conic-gradient(var(--panel) 0 25%, var(--hi) 0 50%) 0 0 / 2px 2px; }
.tool:focus-visible, .tbtn:focus-visible { outline: 1px dotted var(--dark); outline-offset: -5px; }
.toolbar .sep { width: 0; height: 34px; border-left: 1px solid var(--lo); border-right: 1px solid var(--hi); margin: 0 5px; }

/* Win95 tooltip (replaces the native title bubble) */
#tip { position: fixed; z-index: 50; display: none; background: var(--tip); border: 1px solid var(--dark);
  padding: 1px 4px; pointer-events: none; white-space: nowrap; }

/* Monitor: a bezel image over a black opening; the 4:3 screen is centred in the opening. */
main { display: flex; justify-content: center; padding: 16px; }
#monitor { position: relative; flex: none; }
main:fullscreen { background: #000; padding: 0; align-items: center; }
#hole { position: absolute; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#bezel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
#bezel[hidden] { display: none; }
#screen_container { position: relative; background: #000; overflow: hidden; }
#screen_container canvas { display: block; width: 100% !important; height: 100% !important; }
#screen_container > div { white-space: pre; font: 14px monospace; line-height: 14px; color: #fff;
  transform-origin: 0 0; }
#status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #c0c0c0; font: 14px monospace; pointer-events: none; }
#status[hidden] { display: none; }

/* Theatre: nothing but the machine */
#theatre_exit { display: none; position: fixed; top: 8px; right: 8px; z-index: 30; opacity: .35; }
#theatre_exit:hover, #theatre_exit:focus-visible { opacity: 1; }
body.theatre { background: #000; }
body.theatre header { display: none; }
body.theatre #theatre_exit { display: block; }
body.theatre main { padding: 0; min-height: 100vh; align-items: center; }

/* Powered off */
#poweroff { display: none; color: #fff; text-align: center; padding: 15vh 16px; font-size: 18px; }
body.off main { display: none; }
body.off #poweroff { display: block; }

@media (max-width: 640px) {
  .tool { width: 36px; height: 36px; }
  .toolbar .sep { display: none; }
  .menubar { flex-wrap: wrap; }
  main { padding: 16px; }
}

/* Clippy's D: tip, pinned to the bottom-right of the window */
#clippy { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column;
  align-items: flex-end; pointer-events: none; }
.clippy-agent { width: 248px; height: 186px; }
.clippy-agent img { width: 100%; height: 100%; image-rendering: pixelated; user-select: none; }
.clippy-balloon { position: relative; pointer-events: auto; width: 260px; margin: 0 40px 14px 0;
  background: #ffffcc; border: 1px solid #000; border-radius: 10px; padding: 10px 12px;
  font: 13px/1.35 Tahoma, Verdana, sans-serif; -webkit-font-smoothing: auto; }
.clippy-balloon[hidden] { display: none; }
.clippy-balloon p { margin: 0; }
.clippy-balloon hr { border: 0; border-top: 1px solid #c8c8a0; margin: 10px -2px; }
.clippy-balloon button { display: block; margin: 0 auto; min-width: 96px; padding: 4px 16px; font: inherit;
  background: #ffffcc; border: 1px solid #a0a080; border-radius: 4px; color: #000; }
.clippy-balloon button:hover { background: #fff8b0; }
.clippy-balloon button:active { background: #f0e8a0; }
.clippy-balloon button:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
/* the tail, pointing down at Clippy: black outline triangle with a yellow one inside */
.clippy-balloon::before, .clippy-balloon::after { content: ""; position: absolute; right: 70px; border-style: solid; }
.clippy-balloon::before { bottom: -15px; border-width: 15px 0 0 15px; border-color: #000 transparent transparent transparent; }
.clippy-balloon::after { bottom: -13px; right: 71px; border-width: 13px 0 0 13px; border-color: #ffffcc transparent transparent transparent; }

@media (max-width: 640px) {
  .clippy-agent { width: 124px; height: 93px; }
  .clippy-balloon { width: min(260px, calc(100vw - 48px)); margin-right: 8px; }
  .clippy-balloon::before { right: 40px; }
  .clippy-balloon::after { right: 41px; }
}
