:root {
    --bg-primary-color: #61C6FF;
    --bg-secondary-color: rgba(202, 173, 255, 0.25);
    --bg-nav-color: #fff;
    --bg-nav-active: #FFF7AB;

    --width-sidebar: 12rem;
    --table-cols: 5;
    --table-width: 20rem;
}

img {
    max-width: 100%;
}

html {
    font-size: 3svh;
    font-size: clamp(.3vh, 2.0svh, 2.4vw); 
}

body {
    font-size: 1rem;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-primary-color);
    background-image: url(../svg/bg-1.svg);
    transition: background-color 400ms;
}


body.show-detail[data-uid="classic"] {
    background-color: #4da4d5;
}
body.show-detail[data-uid="black-red"] {
    background-color: #b55656;
}
body.show-detail[data-uid="black-white"] {
    background-color: #689271;
}
body.show-detail[data-uid="letters"] {
    background-color: #3E3E3E;
}
body.show-detail[data-uid="multi-color"] {
    background-color: #86729F;
}
body.show-detail[data-uid="high-low"] {
    background-color: #A6A843;
}


html, body {
	height: 100%; 
	width: 100%; 
	margin: 0; 
	padding: 0; 
	font-family: Gilroy, Arial;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

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

/* Works on Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-secondary-color) #dbdbdb;
}

/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: .1rem;
  height: .15rem;
}

*::-webkit-scrollbar-track {
  background: rgba(0,0,0,.1);
  border-radius: 1rem;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,.1);
  border-radius: 1rem;
}

h1 {
    font-size: 1rem;
    line-height: 120%;
    margin-top: 0;
}
h2 {
    font-size: .8rem;
    line-height: 120%;
    color: #ff5e5e;
}

.logo {
    text-align: center;
}

.logo img {
    width: 80%;
}

.display__window {
    width: 100%;
    margin: 0 auto;
    height: 100%;
    position: relative;
    max-width: 50rem;
}

.block__sidebar {
    width: var(--width-sidebar);
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.block__content {
    width: calc(100% - var(--width-sidebar) * 2);
    height: 100%;
    margin: 0 auto;
}

.navside {
    padding: .5rem;
    gap: .5rem;
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
}
.navside-link {
    background-color: var(--bg-nav-color);
    display: block;
    padding: .4rem 0;
    text-align: center;
    border-radius: 1rem;
    font-size: .7rem;
    cursor: pointer;
    transition: background-color 1s;
}
.navside-link.active {
    background-color: var(--bg-nav-active);
}

.navside-link:hover {
    opacity: .9;
}



.detail {
    height: 100%;
    position: relative;
}
.detail__content {
    overflow-y: auto;
    padding: 1rem;
    font-size: .8rem;
    padding-top: 4rem;
}
.maintext {
    color: #2b2b2b;
    font-size: .8rem;
}

.float {
    display: inline-block;
    border: 1px solid #df5047;
    float: right;
    width: 6rem;
    font-size: .5rem;
    color: #df5047;
    padding: .5rem;
    border-radius: .5rem;
    margin-left: .5rem;
}

.detail__nav {
    width: 100%;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}
.detail__nav .btn {
    display: inline-block;
    width: 3rem;
    height: 2rem;
    font-size: 1.6rem;
    line-height: 2rem;
    border-radius: 1rem;
    border: unset;
    background-color: var(--bg-nav-active);
    color: #fff;
    cursor: pointer;
}
.detail__nav .btn:hover {
    opacity: .8;
}
.page-info {
    height: 1rem;
    min-width: 5rem;
    background-color: #fff;
    border-radius: 1rem;
    font-size: .6rem;
    line-height: 1rem;
    text-align: center;
}



.result {
    width: 18rem;
    margin: 0 auto;
}

.words__result {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.words__result-item {
    cursor: pointer;
    display: inline-block;
    padding: .3rem .5rem;
    background: cadetblue;
    color: #fff;
    border-radius: .4rem;
    width: calc(50% - .25rem);
    text-align: center;
}
.words__result-item:hover {
    opacity: .8;
}

.words__result-item.show[data-result="1"] {
    background-color: #599d59;
}
.words__result-item.show[data-result="0"] {
    background-color: #ff7f7f;
}


.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 18rem;
    margin: 0 auto .5rem auto;
    gap: 1rem;
}

.head-progress {
    position: relative;
    background: #e1e1e1;
    height: .3rem;
    overflow: hidden;
    border-radius: .5rem;
    flex: auto;
}

.head-progress .b {
    background: cadetblue;
    display: inline-block;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 700ms;
}

.head-speed {
    font-size: .6rem;
    width: 5rem;
    text-align: right;
}


.table {
    display: grid;
    grid-template-columns: repeat(var(--table-cols), 1fr);
    grid-template-rows: repeat(var(--table-cols), 1fr);
    grid-column-gap: 0;
    grid-row-gap: 0;
    grid-gap: 1px;
    background-color: #e1e1e1;
    width: var(--table-width);
    margin: 1rem auto 0 auto;
    font-size: 2rem;
    position: relative;
}

.table-9x9 {
    font-size: .9rem;
}
.table-8x8 {
    font-size: 1rem;
}
.table-7x7 {
    font-size: 1.2rem;
}
.table-6x6 {
    font-size: 1.4rem;
}
.table-5x5 {
    font-size: 1.6rem;
}
.table-4x4 {
    font-size: 1.8rem;
}
.table-3x3 {
    font-size: 2rem;
}

.table-input,
.table-placement {
    width: 48%;
    font-size: .9rem;
}

.table-input input[type="tel"] {
    display: inline-block;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    line-height: 100%;
    text-align: center;
    font-size: 1rem;
    outline: unset;
    border: unset;
}

.table-input input[type="tel"]:focus {
    background-color: #f9f5ee;
}

.slt {
    background-color: #fff;
    position: relative;
    cursor: pointer;
}

.table-placement .slt {
    cursor: default;
}

.slt img {
    width: 100%;
    display: block;
}
.slt span {
    display: flex;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.table-multi-color,
.table-high-low {
    color: #fff;
}

.t-red {
    background-color: #8d0000;
    color: #fff;
}
.t-black {
    background-color: #232323;
    color: #fff;
}


.bg-1 { background-color: #FF5733; }
.bg-2 { background-color: #4bbd5f; }
.bg-3 { background-color: #5733FF; }
.bg-4 { background-color: #FF48C4; }
.bg-5 { background-color: #007f5a; }
.bg-6 { background-color: #608757; }
.bg-7 { background-color: #7a81b5; }
.bg-8 { background-color: #3712b1; }
.bg-9 { background-color: #C24EFF; }
.bg-10 { background-color: #af008d; }
.bg-11 { background-color: #9d6ca9; }
.bg-12 { background-color: #33C4FF; }
.bg-13 { background-color: #FFC433; }
.bg-14 { background-color: #2674a9; }
.bg-15 { background-color: #FF3333; }
.bg-16 { background-color: #d9720d; }
.bg-17 { background-color: #1dc9b9; }
.bg-18 { background-color: #ff7979; }
.bg-19 { background-color: #9b744e; }
.bg-20 { background-color: #a16464; }
.bg-21 { background-color: #99af38; }
.bg-22 { background-color: #6b6b6b; }
.bg-23 { background-color: #000000; }


@keyframes an1 {
    from { opacity: 1; }
    50% { opacity: 0; }
    to { opacity: 1; }
}
@keyframes an2 {
    from { transform: rotate(0deg); }
    23% { transform: rotate(20deg); }
    77% { transform: rotate(-20deg); }
    to { transform: rotate(0deg); }
}
@keyframes an3 {
    from { transform: scale(1); }
    50% { transform: scale(0.6); }
    to { transform: scale(1); }
}

.animated .an {
    animation-duration: 2s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.animated .an-1 { animation-name: an1; }
.animated .an-2 { 
    animation-name: an2; 
    animation-duration: 3s;
}
.animated .an-3 {
    animation-name: an3; 
    animation-duration: 2000ms;
}

.animated .an-d-1 {
    animation-delay: 100ms;
}
.animated .an-d-2 {
    animation-delay: 700ms;
}
.animated .an-d-3 {
    animation-delay: 1000ms;
}


:root {
    --calc-chess: calc(var(--table-width) / var(--table-cols) * 2);
}

.table-black-white {
    background-image: url(../svg/bg-chess.svg);
    background-size: var(--calc-chess);
    border-color: black;
}

.table-black-white .slt {
    background: unset;
    mix-blend-mode: difference;
    color: #fff; 
}


.flex__table {
    display: flex;
    margin-bottom: 1rem;
    width: 18rem;
    margin-left: auto;
    margin-right: auto;
}


.table__score {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    width: var(--table-width);
    margin: 0rem auto;
}
.table__score-number, .table__score-timer {
    width: 4rem;
    text-align: center;
    background-color: #ededed;
    border-radius: 1rem;
    padding: .2rem;
    font-size: 1.2rem;
}
.table__score-number {

}


.show-speed-result {
    position: absolute;
    top: 4rem;
    height: 10rem;
    background: white;
    width: 100%;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.show-speed-result span {
    font-size: .95rem;
    color: gray;
}
.show-speed-result strong {
    font-size: 3rem;
    font-weight: 400;
}


.words {
    position: relative;
    height: 10rem;
    width: 18rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.words .wlt {
    border-bottom: 1px solid #5d5d5d;
    width: calc(100% / 3 - .7rem);
    text-align: center;
    font-size: 1rem;
    height: 1.5rem;
    display: inline-flex;
    justify-content: flex-start;
}

.words .wlt:nth-of-type(3n+3) {
    justify-content: flex-end;
}
.words .wlt:nth-of-type(3n+2) {
    justify-content: center;
}

.words .wlt span {
    display: none;
}

.words[data-show="1"] .wlt[data-id="1"] span, 
.words[data-show="2"] .wlt[data-id="2"] span, 
.words[data-show="3"] .wlt[data-id="3"] span, 
.words[data-show="4"] .wlt[data-id="4"] span, 
.words[data-show="5"] .wlt[data-id="5"] span, 
.words[data-show="6"] .wlt[data-id="6"] span, 
.words[data-show="7"] .wlt[data-id="7"] span, 
.words[data-show="8"] .wlt[data-id="8"] span, 
.words[data-show="9"] .wlt[data-id="9"] span {
    display: inline-block;
}



.page__info {
    background: #fff;
    padding: 1rem;
    border-radius: .5rem;
    height: 26rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.page__info h2 {
    color: #000;
    font-size: 1.2rem;
}
.page__info p {
    text-align: center;
}



.startup {
    position: absolute;
    width: 100%;
    background-color: #ffffffc4;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    top: 0;
    left: 0;
}

.btn {
    display: inline-block;
    background-color: #5ab7ec;
    color: #fff;
    padding: .5rem 1rem;
    font-size: 1rem;
    border-radius: .5rem;
    border: unset;
    outline: unset;
    cursor: pointer;
}
.btn:hover {
    opacity: .9;
}



body.show-detail[data-uid="black-red"] .btn {
    background-color: #b55656;
}
body.show-detail[data-uid="black-white"] .btn {
    background-color: #689271;
}
body.show-detail[data-uid="letters"] .btn {
    background-color: #3E3E3E;
}
body.show-detail[data-uid="multi-color"] .btn {
    background-color: #86729F;
}
body.show-detail[data-uid="high-low"] .btn {
    background-color: #A6A843;
}

.calendar {
    display: none;
    flex-wrap: wrap;
    gap: 1rem;
    height: 100%;
    padding: 1rem;
}
.calendar__item {
    width: calc(100% / 3 - .6666rem);
    background: #efefef;
    padding: 1rem;
    border-radius: 1rem;
    cursor: pointer;
}
.calendar__item:hover {
    background-color: #e3e3e3;
}
.calendar__item img {
    border-radius: 1rem 0rem;
    max-width: 200px;
    height: 3rem;
    display: block;
    margin-top: .5rem;
}


.detail__head {
    position: absolute;
    width: 100%;
    top: 0;
    padding: 1rem;
}


.btn-back, .link-games, .btn-volume {
    display: inline-block;
    background-color: #fff;
    width: 1.3rem;
    height: 1.3rem;
    text-align: center;
    line-height: 1.3rem;
    border-radius: .1rem;
    cursor: pointer;
    color: black;
    font-size: .8rem;
}

.btn-back {
    font-size: .7rem;
    display: none;
}

body.show-detail .btn-back {
    display: inline-block;
}

#select-numbers, #select-words, #lines {
    font-size: .8rem;
    padding: .3rem .5rem;
    border: unset;
    border-radius: 1rem;
    cursor: pointer;
    display: block;
    width: 7rem;
    text-align: center;
}




.stats {
    display: flex;
    flex-direction: column;
    row-gap: .5rem;
}
.stats-item {
    background-color: #fff;
    padding: .5rem;
    border: 1px solid #e1e1e1;
    border-radius: .3rem;
}
.stats-item h2 {
    margin: unset;
    margin-bottom: .3rem;
    color: #494949;
}
.stats-item p {
    margin: unset;
    color: gray;
    font-size: .7rem;
}




.wrap__number {
    position: relative;
    padding: 2rem 0;
}

.input__number {
    display: flex;
    gap: .1rem;
    justify-content: center;
    margin: 2rem auto;
}

.input__number-item {
    width: 1.1rem;
    height: 1.8rem;
    border: 1px solid #e1e1e1;
    box-shadow: 0rem 0rem .2rem #e1e1e1;
    font-size: 1rem;
    text-align: center;
    line-height: 1.8rem;
}


.keyboard {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    width: 10rem;
    gap: .5rem;
}

.keyboard button {
    cursor: pointer;
    display: inline-block;
    padding: .3rem .5rem;
    background: cadetblue;
    color: #fff;
    border-radius: .1rem;
    width: calc(100% / 3 - .3333339rem);
    text-align: center;
    border: unset;
    font-size: 1rem;
}

.keyboard button:disabled {
    background-color: #a8bbbb;
    cursor: default;
}

.keyboard button[data-symbol="back"] {
    flex: auto;
}
.keyboard button[data-symbol="submit"] {
    flex: auto;
    background: brown;
}


.personaj {
    width: 100%;
    margin-bottom: 3rem;
    height: 14rem;
    background-image: url(../svg/p-classic.svg);
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
}

body.show-detail[data-uid="black-red"] .personaj {
    background-image: url(../svg/p-black-red.svg);
}
body.show-detail[data-uid="black-white"] .personaj {
    background-image: url(../svg/p-black-white.svg);
}
body.show-detail[data-uid="letters"] .personaj {
    background-image: url(../svg/p-letters.svg);
}
body.show-detail[data-uid="multi-color"] .personaj {
    background-image: url(../svg/p-multi-color.svg);
}
body.show-detail[data-uid="high-low"] .personaj {
    background-image: url(../svg/p-high-low.svg);
}



@media (orientation: portrait) {
    html {
        font-size: clamp(.3vh, 2.8svh, 5vw); 
    }

    :root {
        --table-width: 18rem;
    }

    .display__window {
        width: 100%;
    }

    .detail {
        display: none;
    }

    .navside {
        width: 100%;
    }

    .block__sidebar {
        height: 95%;
        width: 100%;
        padding: .5rem;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
    }

    .block__content {
        width: 100%;
    }

    .personaj {
        position: absolute;
        bottom: -2.8rem;
        width: 4rem;
        right: 0;
        height: 6rem;
        width: 6rem;
    }

    #select-numbers, #select-words, #lines, .navside-link {
        font-size: 1rem;
        padding: .6rem;
        border-radius: 2rem;
    }

    .calendar {
        display: flex;
        padding-top: 5rem;
        gap: .6rem;
        width: 100%;
    }

    .calendar__item {
        padding: 0.7rem;
        display: flex;
        flex-direction: column;
        font-size: .8rem;
        width: calc(100% / 3 - .4rem);
    }

    .calendar__item img {
        flex: auto;
        object-fit: cover;
        object-position: top;
    }

    .logo {
        max-width: calc(100% - 4rem);
    }
    .logo img {

    }

    .table__score {
        justify-content: space-between;
    }

    .table__score-number, .table__score-timer {
        padding: .3rem .1rem;
        font-size: 1rem;
    }

    .btn-back, .link-games, .btn-volume {
        font-size: 1rem;
        width: 1.6rem;
        height: 1.6rem;
        line-height: 1.6rem;
    }


    body.show-detail .navside {
        display: none;
    }

    body.show-detail .detail {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        padding-top: 2rem;
        width: 100%;
        height: calc(100% - 6rem);
    }

    .block__right {
        
    }

    .nav__right {
                position: absolute;
        top: 1rem;
        right: 1rem;
        display: flex;
        gap: .5rem;
    }

    .podskazka {
        display: none; 
        position: absolute;
        bottom: .5rem;
        font-size: .6rem;
        background: bisque;
        width: calc(100% - 8rem);
        left: 1rem;
        padding: .5rem;
        border-radius: .5rem;
    }

    .podskazka p {
        margin: .3rem 0;
    }

    .btn-back {

    }

    .detail__content {
        padding-top: 6rem;
    }

    .float, 
    .page-info {
        font-size: .7rem;
    }
    h1 {
        font-size: 1.4rem;
    }
    h2 {
        font-size: 1.2rem;
    }

    .maintext {
        font-size: .9rem;
    }
}

@media (orientation: landscape) {

    html {
        font-size: 3svh;
        font-size: clamp(.3vh, 3.0svh, 2.8vw);
    }


    .block__right {
        width: var(--width-sidebar);
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 1rem 0;
    }
    .nav__right {
        display: flex;
        gap: .5rem;
        justify-content: flex-end;
        padding-right: 1rem;
    }

    .podskazka {
        width: 100%;
        height: 6rem;
        display: flex;
        flex-direction: column;
        gap: .5rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .podskazka p {
        margin: 0;
        color: #fff;
        font-size: .7rem;
    }

}