html {
    font: 16px/28px sans-serif;
    background-color: #D4FFD5;
    color: #132e1a;
}
body {
    margin: 0;
    height: 100vh;
}


a{
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}


img{
    -webkit-user-select: none !important;
}

.junrevel-box {
  //   overflow: hidden;

    max-height: 100vh;
    max-height: 100dvh;
    max-height: 100svh;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    position: relative;

}
canvas{
    display: block;
    object-fit: contain;
    // 方形构图
    aspect-ratio: 1;

    max-width: 100vw;
    max-height: 100dvw;
    max-height: 100svw;

    max-height: 100vh;
    max-height: 100dvh;
    max-height: 100svh;

    margin: auto;
    background-color: #FFF;
}

svg{
    width: 1em;
    height: 1em;
    pointer-events: none;
    fill: none;
    path{
        stroke-width: 1.5;
        stroke: currentColor;
        fill: none;
        // 圆角
        stroke-linecap: round;
        stroke-linejoin: round;
    }
}

.set-level-shadow{
    display: none;
    position: fixed;
    top:0;
    right: 0;
    bottom: 0;
    left:0;
    // background: rgba(212, 255, 213, 0.25);
    z-index: 1;
}

.set-level-box {
    display: none;
    position: absolute;
    z-index: 1;
    background: #FFF;
    width: 200px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 3px 6px 0 rgba(0,0,0,0.1);
    border: 4px solid #111;
    text-align: center;
    font-weight: bold;
    color: #111;


    h2 {
        margin: 0;
        font-weight: normal;
        font-size: 30px;
        line-height: 40px;
        cursor: default;
        padding: 14px 0;

        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

        i{
            width: 36px;
            height: 36px;

            // <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'><path d='M23,11v8c0,6.5-10,6.7-10,0v-8C13,4.4,23,4.4,23,11z M7,19c0,14.5,22,14.6,22,0c0-2.6-4-2.7-4,0c0,3.7-3.1,7-7,7c-3.5,0-7-2.8-7-7C11,16.3,7,16.4,7,19z'/></svg>
            // <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill='none' stroke='#000' stroke-width='3' stroke-linecap='round' d="M20.3,29.6c6.2-6.2,6.2-16.4,0-22.6M16.1,25.4c3.9-3.9,3.9-10.2,0-14.1M11.8,21.1c1.6-1.6,1.6-4.1,0-5.7"/></svg>
            background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"%3E%3Cpath fill="none" stroke="%23000" stroke-width="3" stroke-linecap="round" d="M20.3,29.6c6.2-6.2,6.2-16.4,0-22.6M16.1,25.4c3.9-3.9,3.9-10.2,0-14.1M11.8,21.1c1.6-1.6,1.6-4.1,0-5.7"/%3E%3C/svg%3E');
            background-size: cover;
            position: absolute;
            right: 0;
            top: 0;
            cursor: pointer;
            margin: 11px 8px;
        }

    a {
        padding: 10px;
        font-size: 24px;
        line-height: 28px;
        cursor: pointer;

        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    div{
        display: flex;
        // 倒序
        flex-direction: column-reverse;
    }

    @media (max-width: 420px) {
        // transform: scale(0.7);
    }
}



.ui-btn{
    display: inline-block;
    // background: #FFF;
    font-weight: bold;
    font-size: 24px;
    line-height: 50px;
    border-radius: 10px;
    padding: 0 15px;
    // border: 3px solid #111;
    color: var(--btn-color2);
    box-shadow: 
        0 0 0 3px var(--btn-color2),
        0 4px 0 3px var(--btn-color2);
    
    transition: all 0.1s ease;
    margin: 10px;

    // 禁止选中
    user-select: none;

    &.current{
        background: var(--btn-color1);
        color: #D4FFD5;
    }

    &:hover{
        box-shadow: 
            0 0 0 3px var(--btn-color3),
            0 4px 0 3px var(--btn-color3);
    }
    &:active{
        box-shadow: 
            0 0 0 3px var(--btn-color3),
            0 1px 0 3px var(--btn-color3);
        
        transform: translateY(3px);
    }
    &[data-active="false"]{
        opacity: .5;
        pointer-events: none;
    }
    @media (max-width: 420px) {
        // font-size: 20px;
        // line-height: 40px;
    }
}


.ctrl-box{
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;

    --btn-color1: #2d6539;
    --btn-color2: #164c21;
    --btn-color3: #083111;

}


article{
    font-size: 16px;
    line-height: 22px;
    margin: 20px auto;
    padding: 12px 20px;
    text-align: center;
    h1{
        line-height: 46px;
    }
    p{
        padding: 4px 0;
    }
    .tip-box{
        background: #e4f7e2;
        padding: 10px 15px;
        border-radius: 10px;
        margin: 6px 0;
        color: #132e1a;
    }
}

h1, p {
    margin: 0;
}
footer{
    text-align: center;
    font-size: 14px;
    line-height: 24px;
    padding: 20px 0 40px;

    a{
        margin: 0 2px;
    }
    i{
        opacity: 0.3;
    }
}

.output-shadow{
    position: fixed;
    top:0;
    right: 0;
    bottom: 0;
    left:0;
    padding: 10px;
    background: rgba(0,0,0,.8);
    overflow: auto;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    &[data-hidden="true"]{
        opacity: 0;
        pointer-events: none;
    }
}

.output-box{
    border-radius: 6px;
    background: #D4FFD5;
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 10px 00px;
    text-align: center;
    img{
        display: block;
        width: 100%;
        box-shadow: 0 0 0 3px #164c21;
        border-radius: 2px;
    }
    .tip{
        padding: 16px 0;
    }
    p{
        padding:4px 0;
        line-height: 20px;
    }
    .ctrl-box{
        padding: 0 0 6px;
        .ui-btn{
            margin: 0;
        }
    }

}


.level-rules{
    width: 280px;
    font-size: 14px;
    line-height: 32px;
    text-align: left;
    margin: 4px auto;

    border-radius: 4px;
    border: 2px solid #111;
    color: #111;
    overflow: hidden;
    .item{
        padding: 0 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;

        // FFF', '8AF', 'AFB', 'FE7', 'FB7', 'F77
        &[data-level="0"]{
            background: #FFF;
        }
        &[data-level="1"]{
            background: #8AF;
        }
        &[data-level="2"]{
            background: #AFB;
        }
        &[data-level="3"]{
            background: #FE7;
        }
        &[data-level="4"]{
            background: #FB7;
        }
        &[data-level="5"]{
            background: #F77;
        }
    }
}