* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    background: #ecebeb;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: none;
    text-align: center;
}

noscript {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 40px;
    font-family: font, arial;
}

#installBtn {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    width: 19vmin;
}

#diceplacess {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
#diceplacess > div {
    display: flex;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
}

#selected .dice-placeholder {
    border: solid #a4a1a1 1px;
    border-radius: 1.5vmin;
    background: #f3f3f3;
}

#available {
    flex-grow: 1;
    max-width: 75vmin;
    margin: 0 auto;
}

#dropped {
    background: #dfdede;
    border: solid #a4a1a1;
    border-width: 1px 0 1px 0;
}
#dropped > div {
    max-width: 75vmin;
    display: flex;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
}

#control {
    background: #f3f3f3;
}

#control button:first-of-type {
    border-radius: 1vmin 0 0 1vmin;
}
#control button:last-of-type {
    border-radius: 0 1vmin 1vmin 0;
}

button {
    border: solid #666362 1px;
    font-size: 6vmin;
    background: #a4a1a1;
    color: white;
    text-shadow: 0 0 3vmin rgba(0, 0, 0, 0.5);
    cursor: pointer;
    font-family: font, arial;
    padding: 2vmin 0;
    margin: 1vmin 0;
    width: 40vmin;
    outline: 0;
    -webkit-box-shadow: none;
    box-shadow: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}
@media (hover: hover) {
    button:hover,
    button:focus {
        background: #666362;
    }
}

.dice-placeholder {
    width: 16vmin;
    height: 16vmin;
    margin: 3vmin;
}

.dice .front {
    transform: translateZ(8vmin);
}
.dice .back {
    transform: rotateX(-180deg) translateZ(8vmin);
}
.dice .right {
    transform: rotateY(90deg) translateZ(8vmin);
}
.dice .left {
    transform: rotateY(-90deg) translateZ(8vmin);
}
.dice .top {
    transform: rotateX(90deg) translateZ(8vmin);
}
.dice .bottom {
    transform: rotateX(-90deg) translateZ(8vmin);
}

.dice {
    width: 16vmin;
    height: 16vmin;
    position: absolute;
    z-index: 50;

    perspective: 1000px;
    perspective-origin: 50% 50%;
}
body:not(.noAnim) .dice {
    transition: top 1s, left 1s;
}

.dice > div {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
}
body:not(.noAnim) .dice > div {
    transition: transform 3s;
}

.dice > div div {
    background: hsla(0, 85%, 50%, 0.85);
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid hsla(0, 74%, 39%, 1);
    border-radius: 1vmin;
    box-shadow: 0 0 2vmin rgba(0, 0, 0, 0.2) inset;
    transition: box-shadow 0.3s;
}

.dice.warn {
    box-shadow: 0 0 4vmin 0.5vmin rgba(200, 0, 0, 0.7);
}

.dice.dice-yellow > div div {
    background: #e9d186;
    border: 2px solid #d4b005;
}
.dice.dice-blue > div div {
    background: #63c1e5;
    border: 2px solid #0098d2;
}
.dice.dice-green > div div {
    background: #91c2a2;
    border: 2px solid #219860;
}
.dice.dice-orange > div div {
    background: #e49f75;
    border: 2px solid #cb561b;
}
.dice.dice-purple > div div {
    background: #9994c0;
    border: 2px solid #575295;
}
.dice.dice-white > div div {
    background: #dfdede;
    border: 2px solid #a4a1a1;
}

.dice .dot {
    display: block;
    position: absolute;
    width: 3vmin;
    height: 3vmin;
    background: #fff;
    border-radius: 15px;
    transform: translateX(-50%) translateY(-50%);
    box-shadow: 0 0 1.5vmin rgba(0, 0, 0, 0.2) inset, 0 0 2vmin rgba(255, 255, 255, 0.2);
}
.dice.dice-yellow .dot {
    background: #ab8f1f;
}
.dice.dice-blue .dot {
    background: #0081a9;
}
.dice.dice-green .dot {
    background: #288155;
}
.dice.dice-orange .dot {
    background: #a74c1e;
}
.dice.dice-purple .dot {
    background: #4f4a7e;
}
.dice.dice-white .dot {
    background: #7a7776;
}

.dice .front .dot1 {
    top: 50%;
    left: 50%;
}
.dice .back .dot1 {
    top: 25%;
    left: 25%;
}
.dice .back .dot2 {
    top: 25%;
    left: 50%;
}
.dice .back .dot3 {
    top: 25%;
    left: 75%;
}
.dice .back .dot4 {
    top: 75%;
    left: 25%;
}
.dice .back .dot5 {
    top: 75%;
    left: 50%;
}
.dice .back .dot6 {
    top: 75%;
    left: 75%;
}
.dice .right .dot1 {
    top: 25%;
    left: 25%;
}
.dice .right .dot2 {
    top: 50%;
    left: 50%;
}
.dice .right .dot3 {
    top: 75%;
    left: 75%;
}
.dice .left .dot1 {
    top: 25%;
    left: 25%;
}
.dice .left .dot2 {
    top: 25%;
    left: 75%;
}
.dice .left .dot3 {
    top: 75%;
    left: 25%;
}
.dice .left .dot4 {
    top: 75%;
    left: 75%;
}
.dice .top .dot1 {
    top: 25%;
    left: 25%;
}
.dice .top .dot2 {
    top: 25%;
    left: 75%;
}
.dice .top .dot3 {
    top: 50%;
    left: 50%;
}
.dice .top .dot4 {
    top: 75%;
    left: 25%;
}
.dice .top .dot5 {
    top: 75%;
    left: 75%;
}
.dice .bottom .dot1 {
    top: 25%;
    left: 25%;
}
.dice .bottom .dot2 {
    top: 75%;
    left: 75%;
}

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

@media (orientation: landscape) {
    #available {
        max-width: 90vmin;
    }
    #dropped > div {
        max-width: 100vmax;
    }
}
