html {
    overflow-x: hidden;
    touch-action: pan-y; 
}
.mdiv{
    display: flex;
}

.mlr{
    width:20rem;
    padding-left: 0.75rem;
}
.mlr>div{
    padding: 0.25rem;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.mlr>div:last-child{
    margin-bottom: 0;
}

.night .mlr>div{
    border:1px solid #444;
}
.mlf{
    width:calc(100% - 20rem);
    min-height: 22.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    border: 1px solid #eee;

    background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    overflow: auto;
    padding: 1rem;
}
.night .mlf{
    border: 1px solid #444;
    background-image: linear-gradient(45deg, #2d2d2d 25%, transparent 25%), linear-gradient(-45deg, #2d2d2d 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2d2d2d 75%), linear-gradient(-45deg, transparent 75%, #2d2d2d 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.butdivbut{
    height: 1.8rem;
    line-height: 1.8rem;
    display: block;
    background-color: #06b672;
    border: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

@media screen and (max-width: 1290px){
    .mdiv {
        display:block;
    }
    .mlf {
        width:100%;
        height: 10rem;
    }
    .mlr {
        width: 100%;
        padding-left:0rem;
        margin-top: 0.75rem;
    }
}

/***********************************************/

.colorlist{
 border:1px solid #eee;
 padding: 0.25rem;
}

.night .colorlist{
    border:1px solid #444;
}

.colorlist>div{
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #eee;
    transition: all 0.15s ease;
    float: left;
    margin: 0.2rem;
}

.night .colorlist>div{
    border: 2px solid #444;
}

.grid-wrapper {
    background: var(--grid-wrapper);
    border-radius: 6px;
    padding: 0.25rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 4px 24px rgba(0,0,0,0.15);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.grid-container {
    display: grid;
    gap: 1px;
    padding: 0.25rem;
    background: var(--board-color);
}

.bead {
    position: relative;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    background-color: var(--peg-color);
}

.bead:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 0 0 2px rgba(200, 200, 200, 0.5);
}

body:not(.light-mode) .bead:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.bead.filled {
    background: var(--bead-color);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.3), inset 0 -2px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bead.filled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: var(--board-color); 
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bead:not(.filled)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45%;
    height: 45%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: inherit;
    filter: brightness(1.15);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.bead.pop {
    animation: beadPop 0.15s ease-out;
}

@keyframes beadPop {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#applySize {
    border: 1px solid #eee;
    background-color: #fafafa;
    padding: 0.5rem 0;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
}

.night #applySize {
    background-color: #181a1b;
    border: 1px solid #444;
    color: #bbb;
}

.xibuts .xibutdivs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

.xibuts button {
    border: 1px solid #2196F3;
    background-color: #2196F3;
    padding: 0.5rem 0;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    color: #fff;
}

.xibuts button.c {
    background-color: #607D8B;
    border: 1px solid #607D8B;
}

/********************************************/

.demodatas{
    border: 1px solid #eee;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.75rem;
}

.night .demodatas{
    border:1px solid #444;
}

.demodatas .tits{
    margin-bottom: 0.5rem;
    font-size: 0.6rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.night .demodatas .tits{
    border-bottom: 1px solid #444;
}

.demodatalist{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.demodatalist>div{
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.night .demodatalist>div {
    background-color: #444;
}

.demodatalist>div>div:first-child{
    font-weight: 600;
    color: #3498db;
    margin-bottom: 8px;
    font-size: 0.6rem;
}

.demodatalist>div>div:last-child{
    font-size: 0.6rem;
    word-wrap: break-word;
}

@media screen and (max-width: 1048px){
    .demodatalist{
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 490px){
    .demodatalist{
        grid-template-columns: repeat(1, 1fr);
    }
}