:root {
    --properties-height: 25%;
    --color-1: #db7f67;
    --color-2: #dbbea1;
    --color-3: #a37b73;
    --color-3-light: #dda89d;
    --color-4: #3f292b;
    --color-5: #d34f73;
}

/* Make the emulator pixel perfect with specific zoom */
/* Zoom ×1 */
:root { --emulator-width: 320px; --emulator-height: 250px; }

/* Zoom ×2 */
@media (min-width: 960px) and (min-height: 650px) {
    :root { --emulator-width: 640px; --emulator-height: 500px; }
}

/* Zoom ×3 */
@media (min-width: 1440px) and (min-height: 900px) {
    :root { --emulator-width: 960px; --emulator-height: 750px; }
}

/* Zoom ×4 */
@media (min-width: 1920px) and (min-height: 1100px) {
    :root { --emulator-width: 1280px; --emulator-height: 1000px; }
}

/* Zoom ×5 */
@media (min-width: 2400px) and (min-height: 1400px) {
    :root { --emulator-width: 1600px; --emulator-height: 1250px; }
}

/* Zoom ×6 */
@media (min-width: 2880px) and (min-height: 1650px) {
    :root { --emulator-width: 1920px; --emulator-height: 1500px; }
}

@font-face {
    font-family: Minitel;
    src: url(../font/Minitel.ttf);
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: var(--color-2);
}

p { margin: 0.5em 0 0 0; }
a { color: var(--color-4); }
button, .button {
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.button {
    font-size: 90%;
    padding: 0 0.5em;
}

kbd {
    padding:0.1em 0.6em;
    font-size: 80%;
    font-family: mono;
    background-color: #f7f7f7;
    color: #333;
    border: 0.2em solid #ccc;
    box-shadow: 0 0.2em 0 rgba(0, 0, 0, 0.2),0 0 0 0.3em #ffffff inset;
    border-radius: 0.4em;
    text-shadow: 0 0.2em 0 #fff;
    display: inline-block;
    margin: 0 0.1em;
    line-height: 1.4;
    white-space: nowrap;
}

kbd.unused { color: transparent; }

:focus { outline: 0.3em dashed var(--color-3); }

hr {
    border: none;
    border-top: 0.1em solid var(--color-4);
    margin: 1em 0;
    position: relative;
}

.hidden { display: none; }

.zone-container h1, .tidgets h2, .modal h1 {
    margin: 0;
    padding: 1em 0;
    font-size: 100%;
    background-color: var(--color-5);
    color: white;
    text-transform: uppercase;
    text-align: center;
    font-weight: bold;
}

.zone-control {
    margin: 1rem 0 0 1rem;
    display: flex;
    flex-flow: row wrap;
}

.zone-control>div {
    position: relative;
    padding: 3rem 1rem 1rem 1rem;
    margin: 0 1rem 1rem 0;
    background-color: var(--color-3);
}

.zone-control>div, .zone-control a { color: white; }

.zone-control>div.large { flex: 2; }

.zone-control h2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 1rem;
    text-align: center;
    font-weight: normal;
    padding: 0.5rem 0;
    margin: 0;
    background-color: var(--color-4);
}

.zone-control h3 {
    font-weight: normal;
    font-size: 100%;
    border-bottom: 0.1em solid white;
}

.zone-control h3:first-child { margin-top: 0; }

.zone-control div>button, .modal .content div>button, .button {
    display: inline-block;
    border: none;
    background-color: transparent;
    color: white;
    vertical-align: top;
}

.zone-control div>button:hover {
    border-radius: 0.6em;
    background-color: var(--color-4);
}

.modal .content div>button:hover, .button:hover {
    border-radius: 0.6em;
    background-color: var(--color-3);
}

.zone-control form { text-align: left; }

.zone-control button img, .modal button img, .button img {
    filter: invert(100%);
}

.miedit-control {
    position: fixed;
    bottom: 0;
    left: 0;
    width: var(--emulator-width);
    height: calc(100% - var(--emulator-height));
    overflow-y: scroll;
}

div.jstree::before {
    display: block;
    content: "";
    background-color: black;
    border-radius: 50%;
    width: 1em;
    height: 1em;
    margin: 0.5em 0 0 0.25em;
}

a>.jstree-icon {
    background-size: 100% 100% !important;
}

.miedit-treeactions {
    background-color: var(--color-2);
}

.miedit-tree-forms {
    position: fixed;
    top: 0;
    left: var(--emulator-width);
    width: calc(calc(100% - var(--emulator-width)) / 2);
    height: 100%;
}

.miedit-forms>* {
    display: none;
    padding: 0.7em;
}

.miedit-forms>h1 { display: inherit !important; }

.miedit-forms h2 {
    padding: 0;
    margin-top: 0;
    border-bottom: 0.1em solid var(--color-4);
    font-size: 1rem;
}

.miedit-forms h2 input {
    float: right;
    font-size: 80%;
    background: linear-gradient(#4488e5, #2860b3);
    color: white;
    border-radius: 0.5em;
    padding: 0.2em 0.8em;
    cursor: pointer;
}

.miedit-forms h2 input:hover { background: linear-gradient(#5498f5, #3870c3); }

.miedit-forms .card-header { line-height: 2.25; }
.miedit-forms input[type=number] { width: 3em; }

.miedit-forms label {
    display: inline-block;
    width: 8em;
}

.miedit-forms img {
    max-width: 100%;
    height: auto;
}

.miedit-forms label.box-label {
    position: relative;
    width: inherit;
}

.miedit-radio { display: inline-block; }
.miedit-radio img {
    position: relative;
    top: 0.5em;
}
.radio-label { line-height: 2; }
.miedit-forms .miedit-radio label { width: 10em; }

.miedit-field, .miedit-action { clear: both; }

.miedit-info>* { padding-left: 2.5rem; }
.miedit-info>h3 {
    line-height: 2rem;
    background-image: url(../icon/miicons.svg#miedit-info);
    background-size: 2rem;
    background-position: top left;
    background-repeat: no-repeat;
    margin-bottom: 0;
    margin-top: 0.7em;
}

.miedit-info {
    border-top: 0.1em solid var(--color-4);
    margin-top: 1em;
}

.miedit-forms input[type="text"], .miedit-forms textarea {
    font-family: Minitel;
    font-size: 75%;
}

.emulator-container {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--emulator-width);
    height: var(--emulator-height);
}

x-minitel {
    display: block;
    position:relative;
}

x-minitel canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    width: var(--emulator-width);
    height: var(--emulator-height);
}

.minitel-cursor {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none
}

select { height: 2.6em; }

.minitel-editor { position: relative; }
.minitel-overlay {
    top: 0;
    left: 0;
    position: absolute;
}

/* Tree group open/close */
.jstree-default i.jstree-node,
.jstree-default i.jstree-icon,
.jstree-default i.jstree-file,
.jstree-default i.jstree-folder,
#jstree-dnd.jstree-default .jstree-ok,
#jstree-dnd.jstree-default .jstree-er {
    background-image: url(../icon/32px.svg);
    background-repeat: no-repeat;
}

.jstree-default .jstree-anchor {
    line-height: 32px;
    height: 32px;
}

.jstree-default .jstree-themeicon:empty {
    line-height: 32px;
    vertical-align: middle;
}

.jstree-default .jstree-ocl:empty {
    height: 32px;
    line-height: 32px;
    background-position: -68px 0;
}

.jstree-default .jstree-hovered { background-color: var(--color-5); }
.jstree-default .jstree-clicked { background-color: white; }

/* Mini DRCS editor */
.drcs-checkbox-pixel {
    position: relative;
    overflow: hidden;
    font-size: 0.2em;
    display: inline-block;
}

.drcs-checkbox-pixel input {
    position: absolute;
    left: -9999em;
}

.drcs-checkbox-pixel label {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    background-color: white;
}

.drcs-checkbox-pixel input:checked+label {
    background-color: black;
}

.drcs-checkbox-pixel input:focus+label {
    outline: 1px dashed black;
}

.drcs-actions {
    position: absolute;
    right: 0;
    text-align: right;
}

.drcs-actions button {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.drcs-actions button:hover {
    background-color: white;
    border-radius: 0.5em;
}

/* Tidgets */

.tidgets {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: calc(calc(100% - var(--emulator-width)) / 2);    
    overflow-y: scroll;
}

.tidgets h3 { margin: 0; }
.tidgets h4 {
    font-size: 1rem;
    border-bottom: 0.1em solid var(--color-4);
}
.tidgets>div { margin: 1em 0 1em 1.8em; }
.tidgets>div>div {
    display: inline-block;
    margin-right: 2em;
    margin-bottom: 1em;
}
.tidgets [aria-hidden=true] { display: none; }

.tidgets button.aria-accordion-header {
    display: block !important;
    width: 100%;
    background-color: var(--color-4);
    color: white;
    text-align: left;
    margin-bottom: 0.1em;
    padding: 0.3em 0.6em 0.3em 0;
    border: none;
    font-size: 110%;
}

.aria-accordion-header::before {
    display: inline-block;
    width: 1.5em;
    text-align: center;
}

.aria-accordion-header[aria-expanded="true"]::before { content: "▼ "; }
.aria-accordion-header[aria-expanded="false"]::before { content: "▶ "; }

.tidgets>div button {
    border: none;
    background-color: transparent;
    vertical-align: top;
}

.tidgets>div button:hover {
    border-radius: 0.6em;
    background-color: white;
}

/* Controls */


.miedit-control label[for=speed-setting] {
    display: inline-block;
    width: 6em;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.8);
}

.modal .content {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100%;
    width: 40em;

    transform: translate(-50%, -50%);

    background-color: var(--color-4);
    color: var(--color-2);
}

.modal .modal-close {
    display: block;
    background-color: var(--color-2);
    border: none;
    width: 100%;
    padding: 1em;
}

.modal h2 {
    font-size: 100%;
    border-bottom: 0.1em solid var(--color-2);
}

.modal a {
    color: white;
}

.modal .content>div { margin: 1em 1rem; }
.miedit-recorder progress { float: right; }

.miedit-recorder .recorder-result {
    text-align: center;
    margin: 1rem;
}
