@view-transition {
  navigation: auto;
}

:root {
  --sys: "Silkscreen", "Chicago", system-ui, monospace;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--sys);
  color: #000;
  background: #111;
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-font-smoothing: none;
}

.screen {
  position: relative;
  width: min(720px, 96vw);
  height: min(540px, 92vh);
  aspect-ratio: 4/3;
  background: #fff;
  background-image: repeating-conic-gradient(#000 0 25%, #fff 0 50%);
  background-size: 2px 2px;
  border: 2px solid #000;
  box-shadow:
    0 0 0 6px #1b1b1b,
    0 24px 60px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  user-select: none;
}

.dicon.sel .lbl {
  background: #000;
  color: #fff;
}
.dicon.sel .ic svg {
  filter: invert(1);
}

.menubar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  font-size: 12px;
  view-transition-name: chrome;
}
.menubar .item {
  padding: 1px 9px;
  line-height: 18px;
  color: #000;
}
.menubar .item:hover,
.menubar .item.on {
  background: #000;
  color: #fff;
}
.menubar .item svg {
  display: block;
}
.menubar .spacer {
  flex: 1;
}
.menubar .clock {
  padding: 0 8px;
  font-size: 11px;
  opacity: 0.9;
}

.dropdown {
  position: absolute;
  top: 20px;
  z-index: 1001;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  min-width: 210px;
  padding: 3px 0;
  font-size: 12px;
  display: none;
}
.dropdown.open {
  display: block;
}
.dropdown a {
  display: block;
  padding: 3px 14px;
  color: #000;
  text-decoration: none;
}
.dropdown a:hover {
  background: #000;
  color: #fff;
}
.dropdown hr {
  border: 0;
  border-top: 1px solid #000;
  margin: 3px 0;
}

.desktop {
  position: absolute;
  inset: 20px 0 0 0;
}
.dicon {
  position: absolute;
  width: 78px;
  text-decoration: none;
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dicon .ic {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}
.dicon .ic svg {
  width: 46px;
  height: 46px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}
.dicon .lbl {
  font-size: 11px;
  line-height: 1.15;
  padding: 0 3px;
  text-align: center;
  background: #fff;
}

.stage {
  position: absolute;
  inset: 20px 0 0 0;
  display: grid;
  place-items: center;
}
.win {
  background: #fff;
  border: 1px solid #000;
  box-shadow:
    1px 1px 0 #000,
    2px 2px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-width: 180px;
  position: relative;
}
.titlebar {
  height: 19px;
  border-bottom: 1px solid #000;
  position: relative;
  display: flex;
  align-items: center;
  background: repeating-linear-gradient(to bottom, #000 0 1px, #fff 1px 2px);
}
.closebox {
  position: relative;
  width: 11px;
  height: 11px;
  margin-left: 7px;
  background: #fff;
  border: 1px solid #000;
  display: block;
}
.closebox::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  background:
    linear-gradient(45deg, transparent 45%, #000 45% 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, #000 45% 55%, transparent 55%);
}
.closebox:active {
  background: #000;
}
.closebox:active::after {
  filter: invert(1);
}
.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.body {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
}
.body p {
  margin: 0 0 9px;
}
.body p:last-child {
  margin: 0;
}
.sig {
  margin-top: 10px;
}
.ascii {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
  font-size: 11px;
  line-height: 1.3;
  margin: 0;
}
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #000;
  border-radius: 9px;
  background: #fff;
  color: #000;
  box-shadow: 2px 2px 0 #000;
  text-decoration: none;
  margin-top: 4px;
}
.btn:active {
  box-shadow: 0 0 0 #000;
  transform: translate(2px, 2px);
}

.calc {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.calc .disp {
  border: 1px solid #000;
  background: #fff;
  text-align: right;
  padding: 5px 8px;
  font-size: 16px;
  min-height: 26px;
  overflow: hidden;
}
.calc .pad {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 5px;
}
.calc button {
  font-family: inherit;
  font-size: 13px;
  height: 30px;
  border: 1px solid #000;
  background: #fff;
  box-shadow: 1px 1px 0 #000;
}
.calc button:active {
  box-shadow: 0 0 0;
  transform: translate(1px, 1px);
}
.calc button.op {
  font-weight: 700;
}
.paint {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.paint canvas {
  border: 1px solid #000;
  background: #fff;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
}
.paint .tools {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.tip {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 900;
  font-size: 11px;
  background: #000;
  color: #fff;
  padding: 4px 10px;
}

::view-transition-group(*) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.2, 0.85, 0.25, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none !important;
}
@keyframes vt-late-in {
  0%,
  70% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes vt-late-out {
  0%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

:root:active-view-transition-type(close)::view-transition-new(*) {
  animation-name: vt-late-in;
  animation-duration: 0.45s;
  animation-timing-function: ease;
}
:root:active-view-transition-type(close)::view-transition-old(*) {
  animation-name: vt-late-out;
  animation-duration: 0.45s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
