/* Mission Control 3D: the simulators and their control panel. */

/* Every control in the panel is one width, so their right edges and the
   labels' space line up. */
.setting > :last-child {
    flex: 0 1 9rem;
}

/* The counts reach 64, so they keep two digits' width and the slider beside
   them doesn't shrink as they pass 9. */
.setting output {
    min-width: 2ch;
    text-align: right;
}

.mc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    font-family: var(--font-mono);
}

.mc-stats b {
    color: var(--text);
}

/* ---------- Screens: the 3D viewport and the 2D desktop ---------- */

.mc-viewport,
.mc-screen {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--border);
    touch-action: none;
}

.mc-viewport {
    aspect-ratio: 16 / 10;
    cursor: grab;
}

.mc-viewport:active {
    cursor: grabbing;
}

.mc-viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.mc-viewbtns {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.mc-error {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: var(--pad);
    text-align: center;
    color: var(--text-muted);
}

/* ---------- 2D windows, drawn like macOS windows ---------- */

.mc-world,
.mc-win {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    overflow: hidden;
}

.mc-win {
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.22);
    cursor: grab;
}

.mc-win.dragging {
    cursor: grabbing;
}

.mc-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px;
}

/* Close, minimize and zoom. */
.mc-bar i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
}

.mc-bar i:nth-child(2) {
    background: #febc2e;
}

.mc-bar i:nth-child(3) {
    background: #28c840;
}

.mc-bar b {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.72);
    white-space: nowrap;
}

/* Grey bars standing in for the window's text. */
.mc-body {
    position: absolute;
    inset: 30px 0 0;
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 16px;
}

.mc-body u {
    display: block;
    height: 9px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

/* Resize handle: two diagonal lines in the bottom-right corner. */
.mc-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 55%, rgba(0, 0, 0, 0.25) 55% 62%, transparent 62% 72%, rgba(0, 0, 0, 0.25) 72% 79%, transparent 79%);
}
