@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-repeat: no-repeat;

    --img-trophy-white: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg height='800px' width='800px' version='1.1' id='_x32_' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M102.49,0c0,27.414,0,104.166,0,137.062c0,112.391,99.33,156.25,153.51,156.25 c54.18,0,153.51-43.859,153.51-156.25c0-32.896,0-109.648,0-137.062H102.49z M256.289,50.551l-68.164,29.768v98.474l-0.049,19.53 c-0.526-0.112-47.274-10.112-47.274-78.391c0-28.17,0-69.6,0-69.6h60.385L256.289,50.551z' fill='%23fff'/%3E%3Cpolygon points='315.473,400.717 291.681,367.482 279.791,318.506 256,322.004 232.209,318.506 220.314,367.482 205.347,388.394 196.527,400.476 196.699,400.476 196.527,400.717' fill='%23fff'/%3E%3Cpolygon points='366.93,432.24 366.93,432 145.07,432 145.07,511.598 145.07,511.76 145.07,511.76 145.07,512 366.93,512 366.93,432.402 366.93,432.24' fill='%23fff'/%3E%3Cpath d='M511.638,96.668c-0.033-1.268-0.068-2.336-0.068-3.174V45.1h-73.889v38.736h35.152v9.658 c0,1.127,0.037,2.557,0.086,4.258c0.389,13.976,1.303,46.707-21.545,70.203c-5.121,5.266-11.221,9.787-18.219,13.613 c-3.883,17.635-10.109,33.564-18.104,47.814c26.561-6.406,48.026-17.898,64.096-34.422 C513.402,159.734,512.121,113.918,511.638,96.668z' fill='%23fff'/%3E%3Cpath d='M60.625,167.955c-22.848-23.496-21.934-56.227-21.541-70.203c0.047-1.701,0.082-3.131,0.082-4.258v-9.658 h34.842h0.07l0,0h0.24V45.1H0.43v48.394c0,0.838-0.032,1.906-0.068,3.174c-0.482,17.25-1.76,63.066,32.494,98.293 c16.068,16.524,37.531,28.014,64.092,34.422c-7.996-14.25-14.22-30.182-18.103-47.816C71.846,177.74,65.746,173.221,60.625,167.955 z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");
    --img-trophy-black: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg height='800px' width='800px' version='1.1' id='_x32_' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M102.49,0c0,27.414,0,104.166,0,137.062c0,112.391,99.33,156.25,153.51,156.25 c54.18,0,153.51-43.859,153.51-156.25c0-32.896,0-109.648,0-137.062H102.49z M256.289,50.551l-68.164,29.768v98.474l-0.049,19.53 c-0.526-0.112-47.274-10.112-47.274-78.391c0-28.17,0-69.6,0-69.6h60.385L256.289,50.551z' fill='%23000'/%3E%3Cpolygon points='315.473,400.717 291.681,367.482 279.791,318.506 256,322.004 232.209,318.506 220.314,367.482 205.347,388.394 196.527,400.476 196.699,400.476 196.527,400.717' fill='%23000'/%3E%3Cpolygon points='366.93,432.24 366.93,432 145.07,432 145.07,511.598 145.07,511.76 145.07,511.76 145.07,512 366.93,512 366.93,432.402 366.93,432.24' fill='%23000'/%3E%3Cpath d='M511.638,96.668c-0.033-1.268-0.068-2.336-0.068-3.174V45.1h-73.889v38.736h35.152v9.658 c0,1.127,0.037,2.557,0.086,4.258c0.389,13.976,1.303,46.707-21.545,70.203c-5.121,5.266-11.221,9.787-18.219,13.613 c-3.883,17.635-10.109,33.564-18.104,47.814c26.561-6.406,48.026-17.898,64.096-34.422 C513.402,159.734,512.121,113.918,511.638,96.668z' fill='%23000'/%3E%3Cpath d='M60.625,167.955c-22.848-23.496-21.934-56.227-21.541-70.203c0.047-1.701,0.082-3.131,0.082-4.258v-9.658 h34.842h0.07l0,0h0.24V45.1H0.43v48.394c0,0.838-0.032,1.906-0.068,3.174c-0.482,17.25-1.76,63.066,32.494,98.293 c16.068,16.524,37.531,28.014,64.092,34.422c-7.996-14.25-14.22-30.182-18.103-47.816C71.846,177.74,65.746,173.221,60.625,167.955 z' fill='%23000'/%3E%3C/g%3E%3C/svg%3E");

    --color-blue: #1b7290;
    --body-background: rgb(50 50 50);
    --body-color: rgb(255 255 255);
}

body,
html {
    height: 100%;
    font-size: 22px;
}

body {
    background-color: var(--body-background);
    color: var(--body-color);
    font-family: 'Share Tech Mono', monospace;
    text-align: center;
    position: relative;
    background-image: radial-gradient(50% 50% at top center, rgba(0, 0, 0, .66), #262626), linear-gradient(180deg, #fff, #262626);
}

h1 {
    padding: 0;
    margin: 0 0 0.1em 0;
    font-size: 1.6em;
    letter-spacing: 4px;
    text-shadow: 2px 3px 1px rgb(0 0 0 / 30%);
    background-size: auto 80%;
    background-position: left center;
    background-image: var(--img-trophy-white);
    padding-left: 1.6em;
    display: inline-block;
}

h2 {
    font-size: 3.6em;
    font-weight: bold;
    text-shadow: 6px 4px 0px #0000001a;
}

button {
    font-size: 1em;
    cursor: pointer;
}

.center {
    text-align: center;
    justify-content: center;
    align-items: center;
}

.flex {
    display: flex;
}

.pattern {
    z-index: -1;
}

.pattern svg {
    width: 100%;
    height: 100%;
    fill: transparent;
    stroke: transparent;
}

/** **/

#header {
    height: 4em;
    overflow: hidden;
    position: relative;
}

#header .flex {
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

#header p {
    display: none;
}

#beta {
    display: inline-block;
    background: #c53088;
    color: #fff;
    padding: .2em .4em;
    text-align: center;
    font-weight: bold;
    font-family: Consolas, Arial, Helvetica, sans-serif;
    position: absolute;
    top: 0;
    right: 0;
}

#header p {
    font-size: .8em;
    color: grey;
}

/** **/

#footer {

    overflow: hidden;
    padding-top: 1em;
    font-family: Consolas, Arial, Helvetica, sans-serif;
    opacity: .8;
    text-align: right;
}

#footer a {
    color: #fff;
}

#footer p {
    font-size: 60%;
    margin: 0;
    padding: 0;
}

#mid {
    overflow: hidden;
    text-align: center;
}

#mid-holder {
    max-height: 100vh;
    overflow: hidden;
    display: inline-block;
    position: relative;
    /* padding: 0 2em; */
    /* color: #fff; */
    /* background-color: var(--body-background); */
    /* box-shadow: 1px -1px 17px 2px rgb(0 0 0 / 17%); */
}

#mid.intro {
    position: relative;
}

#mid.intro::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-position: center center;
    filter: blur(15px);
}

/** **/

#content {
    margin: auto;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1em;
    align-items: stretch;
}

.right-side {
    position: relative;
    min-width: 12em;
}

.left-side {
    position: relative;
    background-color: var(--body-background);
    border: 3px solid #000;
}


/** **/

.right-side .keys {
    margin-top: 3em;
}

.keys.flex {
    gap: 1em;
    justify-content: center;
}

.keys_holder {
    display: inline-block;
}

.keys_holder .flex {
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.keys_holder .key_row {
    margin-bottom: 4px;
}

.keyspace {
    height: 1.6em;
}

.key_row {
    text-align: left;
}

.key_row.flex {
    justify-content: space-between;
}



.keys_holder button.key {
    font-size: 1em;
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    border: 1px solid #bebebe;

    box-shadow: 0px 3px 0px -2px rgba(255, 255, 255, 1), 0px 2px 0px 0px rgba(169, 169, 169, 1);
    font-weight: bold;
    text-align: center;
    line-height: 1em;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 2px;

    outline: 2px solid rgb(0 0 0 / 29%);
    background-size: auto 50%;
    background-position: center center;
    color: transparent;
}

.keys_holder button.key.spacebar {
    width: 4.5em;
}

.keys_holder button.key:hover {
    background-color: #75b4fb;
    border: 1px solid #5a88c5;
    box-shadow: 0px 3px 0px -2px rgba(117, 180, 251, 1), 0px 2px 0px 0px rgba(90, 136, 197, 1);
}

.keys_holder button.key:active {

    margin-top: 2px;
    box-shadow: none;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
}

.key[data-event="up"] {
    background-image: url(img/up.svg);
}

.key[data-event="down"] {
    background-image: url(img/down.svg);
}

.key[data-event="left"] {
    background-image: url(img/left.svg);
}

.key[data-event="right"] {
    background-image: url(img/right.svg);
}

.keys_holder button.key[data-event="Escape"] {
    background-image: url(img/esc.svg);
    background-size: 80%;
}

.keys_holder button.key[data-event="p"] {
    background-image: url(img/p.svg);
    background-size: 80%;
}


/** **/

#main_menu {

    background: #fff;
    position: absolute;
    top: -50%;
    left: 10%;
    right: 10%;
    box-shadow: 4px 5px 2px #000;
    transition: top ease-out 1s;
}

#main_menu h2 {

    color: var(--color-blue);
}

.intro #main_menu {
    top: 26%;
}

#main_menu p {
    display: inline-block;
}

#main_menu_in {
    position: relative;
    padding: 2em 0 2em 0;
}

#main_menu_pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

#main_menu_content {
    position: relative;
    z-index: 1;
}

#main_menu svg {
    stroke: #fff;
}

#main_menu svg .on {
    fill: #f5f5f5;
}



#main_menu_player {
    position: relative;
    margin-top: .6em;
}

#main_menu_player p {
    z-index: 66;
    background-image: var(--img-trophy-black);
    background-size: auto 80%;
    background-position: left center;
    padding: .2em 0 .2em 4em;
    margin: 1.4em 0;
    position: relative;
}

#main_menu input {
    font-size: 1.4em;
    text-align: center;
    font-family: Consolas, Arial, Helvetica, sans-serif;
    padding: .4em;
    width: 12em;


    color: #000;
    border: 2px solid #474d651a;
    background-color: rgb(211 224 233 / 66%);
    outline: 4px solid rgb(115 136 183 / 18%);
    border-radius: 2px;
}

#welcome_buttons {
    margin: 1em 0;
}

#welcome_buttons button {

    background: transparent;
    border: 2px solid #fff;
    border-radius: 4px;
    margin: 0 4px;
    font-size: .8em;
    padding: .4em 1em;
    color: #fff;
}

#main_menu_press {
    position: relative;
    font-size: 1.2em;
    margin-top: .6em;
    font-weight: bold;
    color: #000;
    padding-top: 1em;
}

#main_menu_press::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    border-radius: 6px;
    height: 3px;
    background: var(--color-blue);
}


.intro #keys,
.intro #header,
.intro .tetris-preview {
    opacity: .1;
}

/** **/

.score {
    text-align: right;
    font-size: 2em;
    margin-top: .6em;
    padding: .2em;
    /* background-color: rgb(0 0 0 / 33%); */
    text-shadow: 2px 3px 1px #000000;
    border-bottom: 1px solid rgb(0 0 0 / 15%);
}


/** **/

.score-list {
    font-weight: normal;
    font-size: .7em;
    border-collapse: collapse;
    width: 100%;
    border: 1px solid rgb(0 0 0/ 15%);
    padding: 1px;
}

.score-list td,
.score-list th {
    padding: .2em .4em;
    text-align: left;
}

.score-list th {
    text-align: right;
}

.score-list tr:nth-child(odd) {
    background-color: rgb(0 0 0 / 10%);
}

span[data-label="percent"] {
    opacity: .4;
    margin-left: 1em;
}

/** **/

.game-stats {
    margin: 1em 0 2em 0;
    border-collapse: collapse;
    width: 100%;
}

.game-stats td {
    opacity: .6;
    text-align: right;
}

.game-stats th,
.game-stats td {
    border-bottom: 1px solid rgb(0 0 0/ 15%);
    padding: .2em .2em;
}

.game-stats th {
    padding-left: .2em;
    padding-right: 2em;
    font-weight: normal;
    text-align: left;
}

/** **/

.game-pause {
    position: absolute;
    top: 30%;
    left: 10%;
    right: 10%;
    display: none;
}

/** **/

.blink {
    animation: blinker 1.2s linear infinite;
}

#body_pattern {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5%;
    height: 20%;
    z-index: -1;
}

#body_pattern svg {
    stroke: transparent;
    stroke-width: 2px;
}

#body_pattern svg .on {
    fill: rgb(0 0 0 / 10%);
}

/** **/

.foot-info {
    font-size: .7em;
    position: absolute;
    bottom: 0.2em;
    left: 0;
    right: 0;
    font-family: Consolas, Arial, Helvetica, sans-serif;
    opacity: .4;
}

.foot-info a {
    color: #fff;
    text-decoration: none;
}

/** **/

.stats-full {
    background-color: #222;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    z-index: 0;
}

.stats-full h3 {
    padding: .6em;
}

.stats-full table {
    width: 100%;
    border-collapse: collapse;
    opacity: .7;
}

.stats-full td,
.stats-full th {
    border-bottom: 1px solid #333;
    border-right: 1px solid #333;
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    padding: .2em .4em;
}

.stats-full thead th {
    background-color: #333;
    color: #fff;
    padding: .4em;
}

.stats-full tbody td {
    text-align: right;
}

.stats-full tbody th {
    text-align: left;
}

.stats-full tbody tr:nth-child(odd) {
    background-color: #181818;
}


/** **/

@keyframes blinker {
    50% {
        opacity: 0.2;
    }
}

/** Media queries **/

@media (max-width: 1024px) {
    body {
        font-size: 18px;
    }
}


@media (max-height: 1024px) {
    body {
        font-size: 19px;
    }
}

@media (max-height: 900px) {
    body {
        font-size: 18px;
    }
}

@media (max-height: 768px) {
    body {
        font-size: 16px;
    }

    #main_menu {
        top: 20%;
        left: 5%;
        right: 5%;
    }

    .preview-holder {
        font-size: 0.8em;
    }

    .score {
        margin: 0;
        padding: .4em .2em;
    }

    .game-stats {
        margin: 0 0 1em 0;
    }
}

@media (max-height: 720px) {
    body {
        font-size: 15px;
    }
}