@import url('https://fonts.googleapis.com/css?family=Aclonica|Noto+Sans+SC:100,300,400,500,700,900&display=swap');

* {
    box-sizing: border-box;
    font-family: Noto Sans SC;
}

body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 50px;
}

.die {
    background-image: url("./img/dice-sheet.png");
    background-size: 300%;
    background-position-x: 0%;
}

.die.d4  { background-position-y: 0%; }
.die.d6  { background-position-y: 20%; }
.die.d8  { background-position-y: 40%; }
.die.d10 { background-position-y: 60%; }
.die.d12 { background-position-y: 80%; }
.die.d20 { background-position-y: 100%; }

main {
    display: flex;
    width: 100%;
    height: 100%;
}

#dice {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#dice > div {
    display: flex;
}

#dice .die {
    width: 150px;
    height: 150px;
    cursor: pointer;
}

#dice .die:hover  { background-position-x: 50%; }
#dice .die:active { background-position-x: 100%; }

#dice .die:hover::after {
    display: flex;
    font-family: Aclonica;
    font-size: 50px;
    color: #fff;
    opacity: 0.9;
    height: 100%; 
    align-items: center;
    justify-content: center;
    position: relative;
}

#dice .die.d4:hover::after  { content: '4'; top: 15px; right: 3px; }
#dice .die.d6:hover::after  { content: '6'; top: 5px; right: 1px; }
#dice .die.d8:hover::after  { content: '8'; top: 2px; }
#dice .die.d10:hover::after { content: '10'; }
#dice .die.d12:hover::after { content: '12'; top: 4px; }
#dice .die.d20:hover::after { content: '20'; }

#dice input {
    width: 100px;
    font-size: 30px;
    margin-top: 30px;
}

#set {
    width: 30%;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    padding-right: 3.5%;
    user-select: none;
}

#set > div {
    font-size: 35px;
    text-align: end;
    width: 230px;
    cursor: pointer;
    height: 60px;
}

#set span:first-child {
    font-size: 25px;
    position: relative;
    bottom: 4px;
}

#set .die {
    display: inline-block;
    width: 50px;
    height: 50px;
    position: relative;
    top: 12px;
}

#buttons {
    width: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#buttons button {
    width: 80px;
    height: 80px;
    font-size: 50px;
    padding-bottom: 5px;
    line-height: 0;
    cursor: pointer;
}

#output {
    width: 30%;
}

#readout {
    overflow-y: scroll;
    white-space: pre-wrap;
    border: 1px solid #bdbdbd;
    padding: 7px;
    height: 100%;
    position: relative;
}

#readout hr {
    margin-left: 0;
    width: 100px;
}

#readout span.total {
    font-weight: 700;
}

#readout span.total span {
    font-weight: 900;
}

#output button {
    border-radius: 100%;
    height: 35px;
    width: 35px;
    border: none;
    color: #fff;
    font-weight: 900;
    font-size: 20px;
    cursor: pointer;
    background: #000;
    opacity: 0.1;
    position: absolute;
    right: 50px;
    z-index: 1;
    margin: 7px;
}

nav {
    position: fixed;
    width: 250px;
    height: 100vh;
    top: 0;
    left: -260px;
    background: #fff;
    box-shadow: -2px 0px 8px #000;
    transition: left 0.3s;
    z-index: 3;
}

nav.open {
    left: 0;
}

#menubtn {
    position: fixed;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    z-index: 1;
    cursor: pointer;
    font-size: 50px;
    padding: 0 10px;
    box-sizing: content-box;
}

#screen {
    display: none;
    background: #000;
    opacity: 0.15;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
}

#screen.on {
    display: block;
}

h1 {
    font-size: 43px;
    font-weight: 300;
    text-align: center;
    margin: 16px 0;
}

h1 span {
    width: 27px;
    height: 27px;
    background-position: 0px 50px;
    display: inline-block;
    cursor: text;
    transform: rotate(30deg);
    position: relative;
    top: 2px;
    margin: 0 -2px;
}