/* --- czcionki lokalne (Google Fonts, licencja SIL Open Font License 1.1) --- */

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/roboto-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                   U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/roboto-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                   U+FFFD;
}

@font-face {
    font-family: 'Courgette';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/courgette-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                   U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Courgette';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/courgette-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                   U+FFFD;
}

/* --- gra --- */

body {
    background: #241f1f;
    padding: 0;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    /* na iOS długie przytrzymanie otwierałoby menu "Zapisz obraz" */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    color: #241f1f;
}

#all, #all-A, #all-B {
    display: flex;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
}

#all-A {
    flex-wrap: wrap;
    /* warstwa narożników nie może przechwytywać gestów kierowanych do planszy;
       przepuszczają je tylko same przyciski (poniżej) */
    pointer-events: none;
}

#all-B {
    align-items: center;
    justify-content: center;
}

#panel-tl, #panel-tr, #panel-bl, #panel-br {
    display: flex;
    flex: 50%;
}

#panel-tl {
    justify-content: flex-start;
    align-items: flex-start;
}

#panel-tr {
    justify-content: flex-end;
    align-items: flex-start;
}

#panel-bl {
    justify-content: flex-start;
    align-items: flex-end;
}

#panel-br {
    justify-content: flex-end;
    align-items: flex-end;
}

#board-ex {
    width: 800px;
    height: 800px;
    background-color: #241f1f;
    display: flex;
    position: relative;
    /* wymagane przez Hammer.js - inaczej przeglądarka przechwytuje gest
       na przewijanie / zoom */
    touch-action: none;
}

#board {
    background: #241f1f;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    display: flex;
    flex-wrap: wrap;
}

#figs {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
}

.field {
    position: relative;
}

/* obrazki nie przechwytują dotyku - gest ma trafiać do #board-ex */
.field img {
    pointer-events: none;
    display: block;
}

.happy {
    -webkit-animation: spin 0.5s infinite linear;
    animation: spin 0.5s infinite linear;
}

@keyframes spin {
    25% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

@-webkit-keyframes spin {
    25% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

#level, #user {
    font-size: 40px;
    padding: 10px;
    font-family: 'Courgette', cursive;
    color: #934d14;
    pointer-events: auto;
}

#level {
    cursor: pointer;
    touch-action: none;   /* Hammer: przytrzymanie = reset poziomu */
}

#next, #prev, #apps, #set-user, #reset-level, #help, #sound {
    color: #934d14;
}

/* przycisk dźwięku: widoczna jest jedna z dwóch ikon */
#sound .ico-off {
    display: none;
}

#sound.muted .ico-on {
    display: none;
}

#sound.muted .ico-off {
    display: block;
}

.crc {
    cursor: pointer;
    margin: 10px;
    pointer-events: auto;
}

.crc:hover {
    transform: scale(1.15);
}

.ico-opt {
    display: block;
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.pop-levels {
    width: 200px;
    height: 100px;
    padding: 10px;
    background: #241f1f;
    display: flex;
    position: absolute;
    flex-wrap: wrap;
    font-size: 10px;

    border-radius: 50px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 1);
}

.lev {
    background: #934d14;
    display: flex;
    padding: 0px;
    margin: 4px;
    position: relative;
    width: 60px;
    height: 60px;
    text-align: center;
    justify-content: center;
    cursor: pointer;
    border-width: 3px;
    border-style: solid;
    border-color: transparent;
    border-radius: 6px;
    align-items: center;
}

.levsel {
    border-color: yellow;
}

.levsolved {
    background: green;
}

.levdisabled {
    background: rgb(48, 43, 43);
    cursor: default;
}

.popup {
    width: 100%;
    height: 100%;
    display: none;
    position: fixed;
    top: 0px;
    left: 0px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.pop-chat-msg {
    width: 200px;
    height: 100px;
    display: flex;
    flex-direction: column;
    position: absolute;
    justify-content: space-around;
    font-size: 10px;
    align-items: center;
    border-radius: 25px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 1);
    background-color: #241f1f;
    color: #934d14;
}

.pop-solution {
    width: 600px;
    height: 300px;
    padding: 1em;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: absolute;
    justify-content: center;
    align-items: center;
    border-radius: 25px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 1);
    background-color: #241f1f;
    color: #934d14;
}

.sol-title {
    align-self: flex-start;
    margin: 0.5em 0 0.3em 0.8em;
}

/* rozwiązania bywają długie - tekst ma się zawijać i przewijać */
.pop-solution textarea {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.35;
}

#solution-moves {
    opacity: 0.75;
}

.sol-info {
    margin-top: 0.6em;
    padding: 0 0.8em;
    text-align: center;
    font-size: 0.85em;
    opacity: 0.8;
}

.sol-error {
    color: #e8913c;
    opacity: 1;
}

.pop-help {
    padding: 1em;
    width: 200px;
    height: 100px;
    flex-direction: column;
    position: absolute;
    justify-content: space-around;
    border-radius: 25px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 1);
    background-color: #241f1f;
    color: #934d14;
    overflow-y: auto;
}

h2 {
    text-align: center;
    margin-top: 0px;
}

h3 {
    text-align: left;
    margin-left: 1em;
    margin-bottom: 0.2em;
}

ul {
    margin-top: 0.2em;
}

li {
    margin-top: 0.2em;
    margin-left: 1em;
}

textarea {
    margin: 10px;
    border: none;
    resize: none;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    border-radius: 10px;
    padding: 10px;
    outline: 0px !important;
    -webkit-appearance: none;
    background-color: #934d14;
    color: #241f1f;
    /* body ma user-select: none - w polach tekstowych zaznaczanie musi działać,
       inaczej nie da się skopiować listy ruchów */
    user-select: text;
    -webkit-user-select: text;
}
