/* Dialog layout and readability adjustments over the bundled 98.css controls. */
[data-window-type="display"] .retro-window {
    box-sizing: border-box;
}

[data-window-type="display"] .title-bar {
    flex-shrink: 0;
}

[data-window-type="display"] .retro-window.show-content .display-content,
[data-window-type="display"] .retro-window.measure-display .display-content {
    height: auto;
    min-height: 0;
    flex: 1;
    padding: 12px;
}

form.display-properties {
    /* The classic dialog owns its colors, including on iOS form controls. */
    color: #222;
    color-scheme: light;
    text-align: left;
    line-height: 1.4;
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
    text-rendering: auto;
    font-kerning: none;
    letter-spacing: 1px;
}

.display-taskbar-option, .display-cloud-option { margin-top: 12px; }
.display-properties .field-row-stacked[hidden] { display: none; }
.display-properties fieldset {
    margin: 0 0 12px;
}

.display-properties .field-row-stacked + .field-row-stacked {
    margin-top: 10px;
}

.display-properties select {
    width: 100%;
}

.display-monitor {
    width: 220px;
    padding: 18px 18px 12px;
    margin: 0 auto;
    box-sizing: border-box;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
}

.display-screen {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 4px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    overflow: hidden;
    background: #000;
}

.display-screen canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    clip-path: inset(0 round 4px);
}

.display-screen .display-preview-crt {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.display-monitor-light {
    width: 4px;
    height: 3px;
    margin: 10px 3px 0 auto;
    background: #008000;
}

.display-monitor-base {
    position: relative;
    width: 104px;
    height: 10px;
    margin: 8px auto 14px;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
}

.display-monitor-base::before {
    content: "";
    position: absolute;
    width: 52px;
    height: 8px;
    left: 26px;
    top: -8px;
    background: #a0a0a0;
    box-shadow: inset 2px 0 #dfdfdf, inset -2px 0 #808080;
}

.display-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.display-save-status {
    flex: 1;
}

.display-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

[data-window-type="display"] .retro-window.measure-display {
    display: block;
    visibility: hidden;
    width: 100%;
    height: auto;
}

.display-properties button,
.display-properties label,
.display-properties select,
.display-properties option,
.display-properties input {
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    font-kerning: none;
    text-rendering: auto;
}

.display-properties select {
    height: 24px;
}

.display-properties button {
    -webkit-appearance: none;
    appearance: none;
    color: inherit;
    min-height: 25px;
}

.display-properties input,
.display-properties select {
    color: inherit;
}

.display-properties button:disabled {
    color: #808080;
    opacity: 1;
    text-shadow: 1px 1px 0 #fff;
}

.display-choice {
    position: relative;
}

.display-properties button.display-choice-control,
.display-properties button.display-choice-control:active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    height: 24px;
    padding: 3px 3px 3px 5px;
    text-align: left;
    background: white;
    color: #000;
    box-shadow: inset -1px -1px #fff, inset 1px 1px grey, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

.display-choice-control:focus > span:first-child {
    background: navy;
    color: white;
    outline: 1px dotted white;
}

.display-choice-arrow {
    display: grid;
    place-items: center;
    width: 17px;
    height: 18px;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
}

.display-choice-arrow::after {
    content: "";
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid black;
}

.display-choice-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 1px;
    border: 1px solid black;
    background: white;
    color: black;
    box-shadow: 1px 1px #808080;
}

.display-choice-menu [role="option"] {
    padding: 3px 4px;
    cursor: default;
}

.display-choice-menu .is-active {
    background: navy;
    color: white;
}

/* The library's stacked-field spacing applies to descendants too. */
.display-properties .display-choice * {
    margin-top: 0;
}

.display-tabs {
    display: flex;
    gap: 2px;
    padding-left: 3px;
}

.display-properties .display-tabs button {
    min-width: 72px;
    min-height: 24px;
    padding: 3px 10px;
    position: relative;
    border-radius: 3px 3px 0 0;
    box-shadow: inset -1px 0 #0a0a0a, inset 1px 1px #fff, inset -2px 0 grey, inset 2px 2px #dfdfdf;
}

.display-properties .display-tabs [aria-selected="true"] {
    z-index: 1;
    top: 1px;
    padding-bottom: 4px;
}

.display-page {
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
}

.display-page[hidden] {
    display: none;
}

.display-skyline {
    margin-top: 14px;
}

.display-effect-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.display-properties .display-effect-selects .field-row-stacked {
    margin-top: 0;
    min-width: 0;
}

.display-effect-row {
    display: grid;
    grid-template-columns: 130px 1fr 36px;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.display-effect-row output {
    text-align: right;
}
