* {
    margin: 0;
    padding: 0;
}

:root {
    --color-button: #E6E6E6;
    --color-button-light: #F5F5F5;
    --color-button-dark: #999999;
}

body {
    background-color: #737373;
}

#title-bar {
    background-color: #E6E6E6;
    height: 48px;
    padding-bottom: 4px;
    box-shadow: 0 -4px 0 0 #CCCCCC inset, 0 4px 0 0 rgba(0, 0, 0, 0.15), 0 8px 0 0 rgba(0, 0, 0, 0.15);
    border-bottom: #000000 4px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 1000;
}

#menu-show {
    display: none;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 20px;
    line-height: 32px;
    margin-bottom: 8px;
    text-shadow: 4px 4px 0 #444444;
}

*+h2 {
    margin-top: 32px;
}

a:not(.menu-box) {
    color: #FFFFFF;
    text-decoration: none;
}

a:not(.menu-box):hover {
    border-bottom: #FFFFFF 1px solid;
}

a.keyboard-access-anchor {
    font-size: 0;
    user-select: none;
    display: block;
    height: 0;
}

#center {
    display: flex;
    min-height: 100vh;
}

#content {
    margin-top: 64px;
    padding: 32px 0;
    color: #FFFFFF;
    flex: 1;
    box-shadow: 0 -4px 0 0 #595959 inset
}

#menu {
    width: 256px;
    background-color: #333333;
    padding-top: 64px;
    box-sizing: border-box;
    border-right: #595959 4px solid;
    box-shadow: -4px 0 0 0 #000000 inset;
    color: #FFFFFF;
    position: relative;
}

#menu::after {
    content: '';
    display: block;
    width: 248px;
    background-color: #333333;
    height: 8px;
    position: absolute;
    bottom: -6px;
}

.menu-box {
    padding-top: 8px;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-decoration: none;
    color: #FFFFFF;
    outline: none;
    position: sticky;
    top: 64px;
    cursor: default;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #595959;
    width: 228px;
    height: 56px;
    padding: 8px 16px;
    box-sizing: border-box;
    border: #000000 4px solid;
    box-shadow: 4px 0 0 0 #404040 inset;
    cursor: pointer;
}

.menu-item+.menu-item {
    margin-top: 8px;
}

.menu-item.selected {
    width: 240px;
    position: relative;
    left: 4px;
    background-color: #737373;
    border-right-width: 0;
    box-shadow: 4px 0 0 0 #595959 inset;
}

.menu-box:focus .menu-item.selected {
    border-color: #FFFFFF;
    outline: none;
}

.menu-item>.pixel-hotkeys-key-box {
    display: none;
}

.menu-box:focus .menu-item.selected>.pixel-hotkeys-key-box {
    display: flex;
}

.tabpage.hide {
    display: none;
}

.page {
    margin: 0 auto;
    width: min(calc(100vw - 64px - 256px), 1000px);
}

#expression {
    width: 100%;
    height: 128px;
    resize: none;
    outline: none;
    box-sizing: border-box;
    border: #000000 4px solid;
    background-color: #4C4C4C;
    box-shadow: 0 4px 0 0 #333333 inset, 0 -4px 0 0 #666666 inset;
    padding: 8px;
    font-size: 16px;
    font-family: Monaco,Consolas,'Lucida Console','Courier New',serif;
    color: #FFFFFF;
}

#expression:focus {
    border: #FFFFFF 4px solid;
}

button {
    --color-button-box-shadow: 
        0 4px 0 0 var(--color-button-light) inset,
        0 -8px 0 0 var(--color-button-dark) inset,
        0 -12px 0 0 var(--color-button-light) inset,
        4px 0 0 0 var(--color-button-light) inset,
        -4px 0 0 0 var(--color-button-light) inset;
    --color-button-box-shadow-active: 
        0 4px 0 0 var(--color-button-light) inset,
        0 -4px 0 0 var(--color-button-dark) inset,
        0 -8px 0 0 var(--color-button-light) inset,
        4px 0 0 0 var(--color-button-light) inset,
        -4px 0 0 0 var(--color-button-light) inset;
    min-width: 256px;
    height: 64px;
    outline: none;
    box-sizing: border-box;
    border: #000000 4px solid;
    background-color: var(--color-button);
    box-shadow: var(--color-button-box-shadow);
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 8px;
    cursor: pointer;
    color: #000000;
}

button:focus {
    border: #FFFFFF 4px solid;
    position: relative;
    z-index: 1;
}

button:active {
    position: relative;
    top: 4px;
    height: 60px;
    box-shadow: var(--color-button-box-shadow-active);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

button.primary {
    --color-button: #108010;
    --color-button-light: #52A652;
    --color-button-dark: #005900;
    color: #FFFFFF;
}

button+button {
    margin-left: -4px;
}

.expression-controller {
    margin: 8px 0;
    display: flex;
}

.expression-controller>button {
    flex: 1;
    min-width: unset;
}


table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    border: #000000 4px solid;
    box-sizing: border-box;
    margin-bottom: 10vh;
}

table tbody {
    height: 100%;
}

table tbody tr:nth-child(even) {
    background-color: #808080;
}

table tbody tr:nth-child(odd) {
    background-color: #999999;
}

table tbody tr:first-child {
    background-color: #E6E6E6;
    color: #000000;
    height: 48px;
    box-sizing: border-box;
    padding-bottom: 4px;
    box-shadow: 0 -4px 0 0 #000000 inset, 0 4px 0 0 rgba(0, 0, 0, 0.15), 0 8px 0 0 rgba(0, 0, 0, 0.15);
    border-bottom: #000000 4px solid;
    margin-bottom: 8px;
    position: sticky;
    top: 52px;
    z-index: 10;
}

.mapping-table tr th:last-child {
    text-align: left;
}

.mapping-table tr td:first-child {
    text-align: center;
}

table tbody tr td,
table tbody tr th {
    padding: 4px 8px;
}

.tag {
    display: inline-block;
    margin: 4px;
    background-color: #737373;
    padding: 4px 8px;
    border: #595959 4px solid;
}


#footer {
    background-color: #333333;
    border-top: #000000 4px solid;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #C7C7C7;
}

#footer a:not(.menu-box){
    color: #C7C7C7;
}

#footer a:not(.menu-box):hover {
    border-bottom: #C7C7C7 1px solid;
}

@media screen and (max-width: 760px) {
    h1 {
        font-size: 24px;
    }

    #menu-show {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
    }

    #menu {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
    }

    #menu.m-show {
        display: flex;
        border: unset;
        box-shadow: unset;
        width: 100%;
        z-index: 100;
    }

    .menu-box {
        width: 100%;
    }

    .menu-item {
        width: 100%;
        padding: 8px 16px;
        border: unset;
        box-shadow: unset;
    }

    .menu-item.selected {
        width: 100%;
        position: unset;
        left: unset;
        box-shadow: unset;
    }

    .menu-box:focus .menu-item.selected>.pixel-hotkeys-key-box {
        display: none;
    }

    #menu::after {
        display: none;
    }

    .page {
        width: min(calc(100vw - 32px), 1000px);
    }
}