@font-face {
    font-family: 'Roboto Slab';
    src: url(../fonts/roboto-slab-regular.woff);
}

@font-face {
    font-family: 'Roboto Slab';
    src: url(../fonts/roboto-slab-bold.woff);
    font-weight: bold;
}

:root {
    --size: 4;
    --board-size: 85vmin;
    --color0: tomato;
    --color1: orange;
    --color2: gold;
    --color3: limegreen;
    --color4: deepskyblue;
    --color5: mediumpurple;
    --color6: darkgoldenrod;
    --color7: silver;
    --color8: darkslategray;
    --color9: whitesmoke;
}

body {
    font-family: 'Roboto Slab', serif;
    background-color: white;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    transition: opacity 2s ease;
}

#outer {
    display: table;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

#middle {
    display: table-cell;
    vertical-align: middle;
}

#inner {
    margin-left: auto;
    margin-right: auto;
}

h1 {
    text-align: center;
    font-size: calc(var(--board-size) / 3.95);
    margin-top: 0;
}

.board {
    display: grid;
    position: relative;
    grid-template-columns: repeat(var(--size), 1fr);
    width: var(--board-size);
    height: var(--board-size);
    background-color: #e9e9e9;
    border-width: 10px;
    border-style: solid;
    border-color: darkgray;
    padding: 1px;
    margin: auto;
}

.cell {
    position: relative;
    height: calc(var(--board-size) / var(--size) - 2px);
    width: calc(var(--board-size) / var(--size) - 2px);
    margin: 1px;
    opacity: 0;
}

.tile {
    position: absolute;
    height: 0;
    width: 0;
    cursor: pointer;
    border-width: calc(var(--board-size) / calc(var(--size) * 2) - 1px);
    border-style: solid;
}

.win-board {
    width: var(--board-size);
    height: var(--board-size);
    border-width: 11px;
    padding: 0;
    transition: padding 0.1s, width 0.1s, height 0.1s, border 0.1s;
}

.win-tile {
    border-width: calc(var(--board-size) / calc(var(--size) * 2));
    margin: -2px;
    transition: margin 0.1s, border 0.1s;
}

.move {
    z-index: 100;
}

.swap {
    z-index: 50;
    transition: all 0.2s linear;
}

#designed {
    position: relative;
    text-align: center;
    align-self: auto;
    color: white;
    font-size: 9px;
    margin-top: -12px;
}

@media (orientation: landscape) and (max-height: 460px) {

    h1 {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {

    :root {
        --color8: rgb(50, 50, 50);
    }

    body {
        background-color: black;
    }

    .board {
        background-color: rgb(20, 20, 20);
        border-color: rgb(90, 90, 90);
    }

    #designed {
        color: black;
    }
}

@media (min-width: 460px) and (min-height: 460px) {

    :root {
        --board-size-big: 400px;
    }

    h1 {
        font-size: 104.8px;
    }

    .board {
        width: var(--board-size-big);
        height: var(--board-size-big);
        border-width: 15px;
        padding: 2px;
    }

    .cell {
        width: 96px;
        height: 96px;
        margin: 2px;
    }

    .tile {
        border-width: 48px;
    }

    #designed {
        font-size: 13.6px;
        margin-top: -18px;
    }

    .win-board {
        width: var(--board-size-big);
        height: var(--board-size-big);
        border-width: 17px;
        padding: 0;
    }

    .win-tile {
        border-width: calc(var(--board-size-big) / calc(var(--size) * 2));
        margin: -4px;
    }
}

.noselect {
    -webkit-tap-highlight-color: transparent;
          -webkit-touch-callout: none;
            -webkit-user-select: none; 
               -moz-user-select: none; 
                -ms-user-select: none; 
                    user-select: none; 
  }