html, body {
    font-family: Orbitron, sans-serif;
    font-size: 6vmin;
}

body {
    margin: 0;
    padding: 0;
    background-color: black;
    color: white;
}

h1 {
    text-transform: uppercase;
    text-align: center;
    margin-top: .5rem;
    margin-bottom: .5rem;
    font-size: 1.5rem;
}


#playarea {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    box-sizing: border-box;
    border: .2rem groove darkgray;
    width: fit-content;
    height: calc(100vh - 2.5rem - .4rem);
    touch-action: none;
}

#gameboard {
    height: calc(100vh - 2.5rem - .4rem);
    width: calc(100% - 5rem - .6rem);
    background-color: #202020;
    /* box-sizing: border-box; */
    border: 2px solid white;
    position: relative;
    background-size: 1em 1em;
    background-image:
      linear-gradient(to right, #505050 2px, transparent 2px),
      linear-gradient(to bottom, #505050 2px, transparent 2px);
    touch-action: none;
    }

#pen {
    width: calc(5rem + .4rem);
    box-sizing: border-box;
    border-left: .2rem ridge gray;
    position: relative;
    max-height: calc(100vh - 2.5rem - .4rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    touch-action: none;
}

.dragging {
    position: fixed !important;
    z-index: 10;
    margin-top: 0 !important;
}

#actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    color: white;
    font-size: 1.25em;
    border-left: 1px solid #303030;
    user-select: none;
    position: sticky;
    top: 0;
    left: 0;
    background-color: #303030;
    width: 100%;
    z-index: 1;
}

#actions > * {
    margin-left: .5ch;
    margin-right: .5ch;
    cursor: pointer;
    user-select: none;
}

#actions > .selected {
    background-color: white;
    color: black;
}

.piece {
    display: grid;
    grid-gap: 0;
    margin-top: 1em;
    box-sizing: border-box;
    position: relative;
    pointer-events: none;
}

.piece1 {
    grid-template-columns: 1em;
}

.piece2 {
    grid-template-columns: repeat(2, 1em);
}

.piece3 {
    grid-template-columns: repeat(3, 1em);
}

.piece4 {
    grid-template-columns: repeat(4, 1em);
}

.piece5 {
    grid-template-columns: repeat(5, 1em);
}

.piece > * {
    aspect-ratio: 1 / 1;
    border-style: solid;
    border-width: .1em;
    border-image: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(0, 0, 0, .2)) 1;
    pointer-events: none;
}

.played {
    position: absolute;
    left: 0;
    top: 0;
    margin-top: 0 !important;
}

#options {
    font-size: .75em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    color: black;
    display: none;
    box-shadow: .25em .25em .25em gray;
    width: 50vw;
    border-radius: .25em;
    z-index: 2;
    padding: 1em;
}

.close {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 1em;
    height: 1em;
    padding: .2em .4em;
    border-radius: .25em;
    line-height: 1;
    color: white;
    background-color: red;
}

button {
    margin-top: .5em;
    font-size: .8rem;
    background-color: lightgreen;
    border: outset lightgreen;
    touch-action: none;
}

#gameboard > button {
    position: absolute;
    bottom: -2em;
    left: .25em;
}

/* The container */
.container {
    display: block;
    position: relative;
    padding-left: 1.5em;
    margin-top: .5em;
    margin-bottom: .5em;
    cursor: pointer;
    font-size: 1em;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  /* Hide the browser's default radio button */
  .container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
  }
  
  /* Create a custom radio button */
  .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 1.1em;
    width: 1.1em;
    background-color: #eee;
    border-radius: 50%;
  }
  
  /* On mouse-over, add a grey background color */
  .container:hover input ~ .checkmark {
    background-color: #ccc;
  }
  
  /* When the radio button is checked, add a blue background */
  .container input:checked ~ .checkmark {
    background-color: #2196F3;
  }
  
  /* Create the indicator (the dot/circle - hidden when not checked) */
  .checkmark:after {
    content: "";
    position: absolute;
    display: none;
  }
  
  /* Show the indicator (dot/circle) when checked */
  .container input:checked ~ .checkmark:after {
    display: block;
  }

  figure {
    font-size: .8em;
    text-align: center;
}

#rules {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    font-size: .8em;
    padding: 1em;
    border: 3px solid ridge gray;
    overflow: auto;
    background-color: black;
    z-index: 100;
}

#rules #close {
    position: fixed;
    right: 3px;
    top: 3px;
    padding: .2em .4em;
    border-radius: .25em;
    line-height: 1;
    color: white;
    background-color: red;
}

#rules img {
    width: 80%;
}

.rules {
    background-color: blue;
    color: white;
    width: 1.5em;
    height: 1.5em;
    border-radius: .75em;
    right: .25em;
    left: unset !important;
    line-height: 1;
    border-color: blue;
}

.show {
    display: block !important;
}

.blank {
    background-color: transparent;
    border: none !important;
}

.white {
    background-color: blanchedalmond;
}

.red {
    background-color: red;
}

.green {
    background-color: green;
}

.blue {
    background-color: blue;
}

.yellow {
    background-color: yellow;
}

.purple {
    background-color: purple;
}

.cyan {
    background-color: cyan;
}

.lightgreen {
    background-color: lightgreen;
}

.gray {
    background-color: gray;
}

.violet {
    background-color: violet;
}

.orange {
    background-color: orange;
}

.blueviolet {
    background-color: blueviolet;
}

.brown {
    background-color: brown;
}

.fuchsia {
    background-color: fuchsia;
}

.pink {
    background-color: pink;
}

.greenyellow {
    background-color: greenyellow;
}

.indigo {
    background-color: indigo;
}

.navy {
    background-color: navy;
}

.slateblue {
    background-color: slateblue;
}

.turquoise {
    background-color: turquoise;
}

.skyblue {
    background-color: skyblue;
}

@media screen and (orientation: landscape) {
    html, body {
        font-size: 4vmin;
    }

    #rules {
        padding-left: 35vw;
        padding-right: 35vw;
    }

    #options {
        width: 25vw;
    }
}



