@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC');
@import url('https://fonts.googleapis.com/earlyaccess/cwtexkai.css');

@font-face {
    font-family: 'STHeiti';
    src: url(../../assets/font/simhei.ttf);
}

html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

body * {
    font-size: calc(1rem + 2vh);
}

img {
    display: flex;
}

html * {
    box-sizing: border-box;
}

html *:not(#warningOverlay *) {
    margin: 0;
    /* padding: 0; */
    font-family: 'STHeiti', Arial, Helvetica, sans-serif;
}

h2 {
    /* margin-bottom: 10px; */
    /* padding: 10px; */
    padding: 1vmin;
    font-family: 'STHeiti', Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: calc(1rem + 2vh);

}

p {
    margin-bottom: 10px;
    padding: 10px;
    font-size: calc(1rem + 2vh);
    font-family: 'STHeiti', Arial, Helvetica, sans-serif;
    font-weight: 700;
}

.row>* {
    text-align: left;
}

#warningOverlay {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: #afd5ea;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 0;
}

/* @media screen and (orientation: portrait) { */
@media (max-aspect-ratio: 4/3) {
    #warningOverlay {
        opacity: 1;
        z-index: 900;
    }
}

/* @media screen and (orientation: landscape) {*/
@media (min-aspect-ratio: 4/3) {
    #warningOverlay {
        opacity: 0;
        display: none;
    }
}

.responsiveWarning {
    margin: initial;
    top: 15%;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.warningBuilding {
    position: absolute;
    width: 100%;
    height: auto;
    bottom: 0;
}

.warningIcon {
    width: 50%;
    max-width: 200px;
}

#instruction {
    font-size: 19px;
    padding: 0 20px;
    color: #059ac9;
    font-family: Helvetica, sans-serif;
    font-weight: 900;
}

#warningMessage {
    font-size: 16px;
    font-weight: 100;
    padding: 0 20px;
    color: #393f4b;
    font-family: Helvetica, sans-serif;
}





#game {
    width: 100%;
    height: 100%;
    display: flex;
    image-rendering: pixelated;
}

canvas {
    width: 100%;
    height: 100%;
    display: flex;
}

#popupPanel {
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ffffff80;
    z-index: 100;
}

#login-panel,
#rule,
#playerName,
#result {
    width: 75%;
    max-width: 900px;
    height: 80%;
    max-height: 550px;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fffdee;
    /* padding: 50px 70px; */
    /* padding: 2.5% 4%; */
    padding: 5vmin 8vmin;
    border: 5px solid #00ade0;
    border-radius: 30px;
    color: #000;
    z-index: 100;
    text-align: center;
}

.title {
    /* height: 20%; */
    height: 10.5vmin;
}

.title img {
    display: flex;
    height: 100%;
}

#rule .title img {
    padding: 2%;
}

#result {
    width: 50%;
    max-width: 600px;
    height: 60%;
    max-height: 400px;
    padding: 4vmin 3vmin;
}

#login-panel .mb-3:nth-child(2) {
    /* padding-top: 1rem; */
    padding-top: 1.5vmin;
}

#login-panel .mb-3:nth-child(3) {
    /* padding-bottom: 5vh; */
    padding-bottom: 5vmin;
}

#rule .mb-3 {
    /* padding-bottom: 2.5vh; */
    padding-bottom: 2.5vmin;
}

#rule .mb-3 h2 {
    text-align: left;
}

label,
input {
    width: 100%;
    display: block;
    /* margin-bottom: 10px; */
    /* padding: 10px; */
    padding: 1vmin;
    /* font-size: calc(1rem + 2vh); */
    font-size: calc(0.5rem + 3vmin);
    font-family: 'STHeiti', Arial, Helvetica, sans-serif;
    font-weight: 700;
    border-radius: 10px;
}

input[type="text"] {
    /* font-size: calc(1rem + 2vh); */
    font-size: calc(0.5rem + 3vmin);
}

input:auto-fill,
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    font-family: 'STHeiti', Arial, Helvetica, sans-serif;
    -webkit-text-fill-color: #000;
    /* font-size: calc(1rem + 2vh) !important; */
    font-size: calc(0.5rem + 3vmin) !important;
}

:focus-visible {
    outline: #cccdc7 auto 0px;
}

#playerName input {
    padding: 20px;
    text-align: center;
}

#playerName ::placeholder {
    text-align: center;
    color: #cccdc7;
}

input {
    border-color: #cccdc7;
    border-style: solid;
    border-width: 4px;
    border-radius: 25px;
}

/* button {
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
} */

a {
    margin: 0 auto !important;
    background-color: transparent;
    border: 0;
    /* height: 12%; */
    height: 6.5vmin;
    cursor: pointer;
    width: initial;
}

#result a {
    margin-top: 3vh;
    /* height: 6vh; */
    height: 6vmin;
}

a img {
    width: auto;
    height: 100%;
    display: flex;
}

.mb-3 {
    width: 100%;
    margin-bottom: 0 !important;
}

.virusList {
    display: grid;
    justify-items: center;
    grid-template-columns: 1fr 2fr 2fr 2fr 2fr 1fr;
    gap: 10px;
}

.virusList img {
    width: 60%;
}

.score {
    display: flex;
    align-items: center;
    /* height: 12vh; */
    height: 10vmin;
}

.score img {
    display: block;
    height: 100%;
}

#user {
    text-align: center;
    /* font-size: calc(1rem + 6vh); */
    font-size: 6vmin;
}

.score h2 {
    text-align: center;
    /* font-size: calc(1rem + 6vh); */
    font-size: 7vmin;
    padding: 1vh 0 1vh 3vh;
}

#suggestion {
    font-weight: 500;
    font-size: calc(0.5rem + 2vmin);
    text-align: center;
}

@media screen and (min-height: 860px) {

    h2 {
        padding: 10px;
    }

    #login-panel,
    #rule,
    #playerName,
    #result {
        padding: 50px 70px;
    }

    .title {
        height: 90px;
    }

    #rule .title img {
        padding: 6px;
    }

    #result {
        padding: 4vmin 3vmin;
    }

    #login-panel .mb-3:nth-child(2) {
        padding-top: 1rem;
    }

    #login-panel .mb-3:nth-child(3) {
        padding-bottom: 40px;
    }

    #rule .mb-3 {
        padding-bottom: 0;
    }

    label,
    input {
        padding: 10px;
        font-size: 34px;
    }

    input[type="text"] {
        font-size: 34px;
    }

    input:auto-fill,
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        font-size: 34px !important;
    }

    a {
        margin: 0 auto !important;
        background-color: transparent;
        border: 0;
        height: 6.5vmin;
        cursor: pointer;
        width: initial;
    }

    #result a {
        height: 52px;
    }

    .score {
        height: 10vmin;
    }

    #user {
        font-size: 52px;
    }

    .score h2 {
        font-size: 60px;
        padding: 10px 0 10px 25px;
    }

    #suggestion {
        font-size: 27px;
    }
}