*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    font-size: 16px;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
    /* background-image: url(paper.jpeg); */
    background-size: contain;
    background-position: center;
}

#paperOverlay{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #e8e8e8;
    top: 0px;
    left: 0px;
}

body,
button {
    font: 1em -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

button {
    background-color: #eee;
    border: 0;
    border-radius: 0.125em;
    box-shadow:
        -0.03em -0.03em 0.25em rgba(0, 0, 0, 0.25),
        0 0 0 0.04em rgba(255, 255, 255, 0.2),
        0.02em 0.02em 0.02em rgba(0, 0, 0, 0.2) inset;
        /* -0.05em -0.05em 0.02em rgba(255, 255, 255, 0.7) inset; */

        /* box-shadow: 15px 15px 30px #bebebe,
                -15px -15px 30px #ffffff; */
    color: #777;
    font-size: 1em;
    outline: 0;
    position: relative;
    vertical-align: top;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

a {
    font: 1em -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: white;
    text-decoration: none;
}

button:not(:last-of-type) {
    margin-right: 0.35em;
}

button:active {
    box-shadow:
        0.1em 0.1em 0.1em rgba(0, 0, 0, 0.2),
        0 0 0 0.05em rgba(0, 0, 0, 0.3),
        -0.025em -0.05em 0.025em rgba(255, 255, 255, 0.8) inset;
}

button span {
    display: inline-block;
}

button>span {
    margin: auto;
    padding: 0.2em 0.375em;
    position: absolute;
    top: 50%;
    left: 0;
    font-size: 0.5em;
    line-height: 2;
    transform: translateY(-50%) scaleX(0.875);
    width: 100%;
}

.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
}

.paper {
    display: flex;
    display: -webkit-flex;
    justify-content: center;
    -webkit-justify-content: center;
    align-items: center;
    -webkit-align-items: center;

    margin-bottom: 4.5em;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.5em;
    color: #eee;
    overflow: hidden;
}

#footer {
    position: fixed;
    left: 0px;
    bottom: 0px;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, #00000000, #222633);
}

#paperStart {
    font-weight: bolder;
}

#underscore {
    animation: blinker 1s linear infinite;
    color: white;
}

#text-input {
    background: none;
    border: none;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1em;
    text-align: center;
    color: black;
    width: 20px;
}

#text-input:focus {
    outline: none;
    border: none;
}

#instructions {
    display: block;
    position: absolute;
    top: 3em;
    color: black;
    font-size: 0.5em;
    font-weight: 50;
}

#refresh {
    display: none;
    font-size: 0.75em !important;
    border: none !important;
    background: none !important;
    box-shadow: none;
    color: black;
    padding-right: 10px !important;
}

#refresh:hover {
    cursor: pointer;
}

@keyframes blinker {
    50% {
      color: rgba(255, 255, 255, 0);
    }
}

/* Keyboard */
.keyboard {
    background: #e0e0e0;
    box-shadow: 15px 15px 30px #bebebe,
                -15px -15px 30px #ffffff;
    /* background-image: linear-gradient(90deg, #9e9e9e, #ccc);
    box-shadow: 0 0 1em rgba(0, 0, 0, 0.5), 0 0 0 1px #aaa inset; */

    border-radius: 0.35em;
    display: grid;
    grid-template-columns: 21.25em 4.125em 5.65em;
    grid-template-rows: 0.75em 1.125em 1.125em 1.125em 1.125em 1.375em;
    grid-gap: 0.375em 0.875em;
    font-size: 36px;
    padding: 0.50em;
    width: 33.65em;
    height: 9.40em;
    overflow: hidden;
    transition: 0.7s linear;
}

@media screen and (max-width: 1300px) {
    .keyboard {
        width: 21.70em;
    }
}

@media screen and (max-width: 830px) {
    .paper {
        margin-top: 4.5em;
    }
    #instructions {
        top: 12em;
    }
    .keyboard {
        margin-top: 9em;
        transform: rotate(90deg);
    }
    .centered {
        position: fixed;
        height: 100vh;
        overflow: scroll;
    }
}

@media screen and (max-height: 500px) {
    .paper {
        margin-top: 8em;
    }
    #instructions {
        top: 20em;
    }
    .keyboard {
        margin-top: 3em;
    }
}

.row:nth-of-type(14) {
    text-align: center;
}

.row:nth-of-type(n + 14):nth-of-type(-3n + 17) {
    transform: translateY(0.25em);
}

.bump {
    border-radius: 0.1em;
    box-shadow: -0.05em -0.02em 0 0.05em rgba(0, 0, 0, 0.3);
    padding: 0;
    top: 85%;
    left: calc(50% - 0.4em);
    width: 0.8em;
    height: 0.15em;
}

/* Button size */
.btn0 {
    width: 1.19em;
    height: 0.75em;
}

.btn1 {
    width: 1.125em;
    height: 0.75em;
}

.btn2 {
    width: 1.125em;
    height: 1.125em;
}

.btn3 {
    width: 2em;
    height: 1.125em;
}

.btn4 {
    width: 2.3em;
    height: 1.125em;
}

.btn5 {
    width: 3.05em;
    height: 1.125em;
}

.btn6 {
    width: 1.5625em;
    height: 1.375em;
}

.btn7 {
    width: 1.8375em;
    height: 1.375em;
}

.btn8 {
    width: 1.125em;
    height: 1.375em;
}

.btn9 {
    width: 2.6875em;
    height: 1.375em;
}

.btn10 {
    width: 1.125em;
    height: 2.875em;
}

.btn11 {
    width: 2.66em;
    height: 0.75em;
}

.btn12 {
    width: 1.8375em;
    height: 1.375em;
}

.btn13 {
    margin-left: 1px;
    margin-top: 0.625em;
    width: 1.125em;
    height: 0.5em;
}

.btn13 span {
    font-size: 0.7em;
    margin-bottom: 2px;
}

.btn14 {
    margin-top: 1.5em;
    width: 1.125em;
    height: 0.5em;
}

.btn14 span {
    font-size: 0.7em;
    margin-bottom: 2.5px;
}


.darkKey {
    background-color: rgb(30, 39, 53) !important;
    color:white;
    box-shadow:
        -0.2em -0.125em 0.125em rgba(0, 0, 0, 0.25),
        0 0 0 0.04em rgba(0, 0, 0, 0.3),
        0.02em 0.02em 0.02em rgba(0, 0, 0, 0.4) inset,
        -0.05em -0.05em 0.02em rgba(15, 26, 42, 0.8) inset !important;
}

.goldKey {
    background-color: rgb(208, 116, 31) !important;
    color:white;
    box-shadow:
        -0.2em -0.125em 0.125em rgba(0, 0, 0, 0.25),
        0 0 0 0.04em rgba(0, 0, 0, 0.3),
        0.02em 0.02em 0.02em rgba(0, 0, 0, 0.4) inset,
        -0.05em -0.05em 0.02em rgba(255, 152, 56, 0.8) inset !important;
}

.btn-longest {
    width: 8.625em;
    height: 1.375em;
}

/* Button text alignment */
.ul,
.ll,
.ur,
.lr {
    top: 0;
    transform: scaleX(0.875);
}

.ul,
.ll {
    text-align: left;
    transform-origin: 0 50%;
}

.ur,
.lr {
    text-align: right;
    transform-origin: 100% 50%;
}

.ll,
.lr {
    top: auto;
    bottom: 0;
}

.noxscale {
    transform: translateY(-50%) scaleX(1);
}

.ll.noxscale,
.lr.noxscale {
    transform: scaleX(1);
}

/* Button font size */
.xxxs {
    font-size: 0.2em;
    line-height: 1.5;
}

.xxs {
    font-size: 0.25em;
    line-height: 1.5;
}

.xs {
    font-size: 0.3em;
    line-height: 1.125;
}

.sm {
    font-size: 0.4em;
    line-height: 1.25;
}

/* Icons */
.up,
.right,
.down,
.left {
    width: 0;
    height: 0;
    vertical-align: 0.1em;
}

.up {
    border-left: 0.25em solid transparent;
    border-right: 0.25em solid transparent;
    border-bottom: 0.5em solid currentColor;
}

.right {
    border-left: 0.5em solid currentColor;
    border-top: 0.25em solid transparent;
    border-bottom: 0.25em solid transparent;
}

.down {
    border-left: 0.25em solid transparent;
    border-right: 0.25em solid transparent;
    border-top: 0.5em solid currentColor;
}

.left {
    border-right: 0.5em solid currentColor;
    border-top: 0.25em solid transparent;
    border-bottom: 0.25em solid transparent;
}

.pause {
    border-left: 0.2em solid;
    border-right: 0.2em solid;
    vertical-align: 0.1em;
    width: 0.475em;
    height: 0.5em;
}

.emoji {
    filter: saturate(0);
    -webkit-filter: saturate(0);
}

.cascade:before,
.cascade:after,
.block {
    border: 1px solid;
}

.cascade {
    position: relative;
    height: 1em;
    width: 1.2em;
}

.cascade:before,
.cascade:after {
    content: "";
    position: absolute;
    height: 0.45em;
    width: 0.8em;
}

.cascade:before {
    top: 0;
    left: 0;
}

.cascade:after {
    right: 0;
    bottom: 0;
}

.block {
    margin-left: 0.1em;
    height: 0.8em;
    width: 0.6em;
    vertical-align: 0.1em;
}

.apps:before,
.apps:after {
    font-weight: bold;
    display: block;
    content: "\25A1\25A1\25A1";
    line-height: 0.875;
}

/* Miscellaneous */
.on {
    color: #8dff00;
    text-shadow: 0 0 2px #478800;
}

.noxpad {
    padding: 0.2em 0;
}

/* IE 11 fix */
@media all and (-ms-high-contrast: none),
(-ms-high-contrast: active) {
    .keyboard {
        display: -ms-grid;
        -ms-grid-columns: 22.125em 5em 5.75em;
        -ms-grid-rows: 1.125em 1.5em 1.5em 1.5em 1.5em 1.375em;
    }

    .row:nth-child(3n + 2) {
        -ms-grid-column: 2;
    }

    .row:nth-child(3n + 3) {
        -ms-grid-column: 3;
    }

    .row:nth-child(n + 4):nth-child(-n + 6) {
        -ms-grid-row: 2;
    }

    .row:nth-child(n + 7):nth-child(-n + 9) {
        -ms-grid-row: 3;
    }

    .row:nth-child(n + 10):nth-child(-n + 12) {
        -ms-grid-row: 4;
    }

    .row:nth-child(n + 13):nth-child(-n + 15) {
        -ms-grid-row: 5;
    }

    .row:nth-child(n + 16) {
        -ms-grid-row: 6;
    }

    .row:nth-of-type(14) button {
        transform: translateX(-0.5em);
    }
}