/* ------------------------------------------------------------------
   desktop.css - the desktop itself: wallpaper, Toolchest, icon grid
   and the clock.
   ------------------------------------------------------------------ */

#desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--desk);
}

/* A part of the desktop that is built but not drawn yet. The desktop
   is put together while the start up screen covers it, then js/main.js
   takes this class off one part at a time. The parts keep their size
   and their place, so the icon grid can still measure them. */
.unspawned {
  visibility: hidden;
}

#wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-repeat: repeat;
  image-rendering: pixelated;
}

/* --- Toolchest -------------------------------------------------------
   The menu panel in the top left corner: a black box holding a dark
   grey header and a stack of rows. Every label is bold italic, and
   every row that opens a menu carries the little chest mark on the
   right. */

#toolchest {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  width: 114px;
  border: 2px solid #000;
  background: var(--tc-face);
}

/* The row heights come from design/toolchest.png: the name band is 23
   pixels tall and every row below it is 26. */
.tc-head {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 23px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px solid #000;
  background: var(--tc-head);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: bold;
  font-style: italic;
  color: var(--ink);
  text-align: center;
  /* Motif draws a dashed ring inside the item that has the keyboard. */
  outline: 1px dotted #000;
  outline-offset: -3px;
}

.tc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 26px;
  padding: 0 4px 0 8px;
  border: 0;
  border-top: 1px solid var(--tc-dk);
  background: var(--tc-face);
  box-shadow: inset 0 1px 0 var(--tc-lt);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: bold;
  font-style: italic;
  color: var(--ink);
  text-align: left;
}

.tc-item:first-of-type {
  border-top: 0;
  box-shadow: none;
}

.tc-item:hover,
.tc-item.open {
  background: var(--tc-lt);
}

/* The chest mark: a lid over a body, the same shape IRIX puts on every
   row that opens a menu. */
.tc-mark {
  position: relative;
  flex: none;
  width: 11px;
  height: 13px;
}

.tc-mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 5px;
  border: 1px solid #000;
  background: var(--tc-face);
}

.tc-mark::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 1px solid #000;
  background: var(--tc-face);
}

/* --- Desktop icons ---------------------------------------------------
   Icons live on a grid. They never take a raw pixel position, so the
   layout survives any screen size. The name sits in a solid light grey
   box, in a plain upright face: IRIX uses the slanted one for menus
   and window titles only. */

#icons {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.dicon {
  position: absolute;
  width: 84px;
  padding: 3px;
  text-align: center;
  visibility: hidden;
}

/* An icon arrives whole, in one frame. The file manager drew them one
   after another, it did not fade them in. */
.dicon.shown {
  visibility: visible;
}

.dicon img {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 3px;
  pointer-events: none;
}

.dicon span {
  display: inline-block;
  max-width: 100%;
  padding: 1px 2px;
  background: var(--icon-label);
  font-family: var(--font-label);
  font-size: 11px;
  line-height: 13px;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
}

.dicon span i {
  display: block;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The icon under the pointer is the selected one. IRIX highlights on
   the way past, it does not wait for a click. */
.dicon:hover span {
  background: var(--select);
}

.dicon:hover span i {
  color: #ffffff;
}

.dicon:hover img {
  filter: brightness(1.25);
}

.dicon.dragging {
  opacity: 0.55;
}

/* The empty cell the icon will drop into. */
#icon-ghost {
  position: absolute;
  z-index: 6;
  border: 2px dotted #ffffff;
  pointer-events: none;
}

/* --- Clock -----------------------------------------------------------
   A small sunken panel in the top right. The readout has a fixed width
   so the panel never changes size as the digits change. */

#clock {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  width: 128px;
  background: var(--face);
  border: var(--bevel) solid;
  border-color: var(--face-lt) var(--face-dk) var(--face-dk) var(--face-lt);
  padding: 3px;
  text-align: center;
}

#clock-time {
  font-family: "SGI Digital", var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  line-height: 28px;
  height: 32px;
  color: #103010;
  background: #85a585;
  border: var(--bevel) solid;
  border-color: var(--face-dk) var(--face-lt) var(--face-lt) var(--face-dk);
  letter-spacing: 1px;
  overflow: hidden;
}

#clock-date {
  font-family: var(--font-label);
  font-size: 11px;
  height: 14px;
  color: var(--ink);
  margin-top: 2px;
  letter-spacing: 1px;
}

/* --- oneko ------------------------------------------------------------ */

#oneko {
  position: fixed;
  width: 32px;
  height: 32px;
  z-index: 8500;
  pointer-events: none;
  image-rendering: pixelated;
  background-image: url("../assets/img/oneko.gif");
}
