h1 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.controls {
    position: relative;
    margin-top: 8px;
    text-align: center;
}

.iloscBorder{
    border: 2px solid rgb(14, 214, 0);
    padding-top: 3px;
    padding-right: 6px;
    padding-left: 6px;
    padding-bottom: 6px;
    font-weight: 600;
    border-radius: 6px;
}

.wzorzec {
    width: 3rem;
    height: auto;
    /*border: 2px solid rgb(14, 214, 0);
    border-radius: 6px;
    padding: 6px;*/
}


button {
    padding: 5px 5px;
    font-size: 1em;
    margin: 0 5px;
    cursor: pointer;
}

#game-container {
    display: grid;
    gap: 2px;
    width: 100%;
    max-width: 1000px;
    height: auto;
    /* desktop limit */
    aspect-ratio: auto;
    /* pozwól gridowi się rozciągać */

    outline: 3px solid #ebb41c;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    margin: auto;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
}

.miesiekOK{
    width: 100%;
    max-width: 400px;
    height: auto;
}


.cell {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /*font-size: clamp(1rem, 2rem, 2.5rem);*/
    /*font-size: clamp(1.3rem, 2.1rem, 2.8rem);*/
    background: #fffdf6;
    cursor: pointer;
    border: 3px solid;
    border-radius: 15px;
}

#game-container .cell:nth-child(16n+1)  { border-color: #FF6B6B; }
#game-container .cell:nth-child(16n+2)  { border-color: #4ECDC4; }
#game-container .cell:nth-child(16n+3)  { border-color: #45B7D1; }
#game-container .cell:nth-child(16n+4)  { border-color: #FFA07A; }
#game-container .cell:nth-child(16n+5)  { border-color: #98D8C8; }
#game-container .cell:nth-child(16n+6)  { border-color: #F7DC6F; }
#game-container .cell:nth-child(16n+7)  { border-color: #BB8FCE; }
#game-container .cell:nth-child(16n+8)  { border-color: #85C1E2; }
#game-container .cell:nth-child(16n+9)  { border-color: #F8B195; }
#game-container .cell:nth-child(16n+10) { border-color: #6C5CE7; }
#game-container .cell:nth-child(16n+11) { border-color: #A8E6CF; }
#game-container .cell:nth-child(16n+12) { border-color: #FFD93D; }
#game-container .cell:nth-child(16n+13) { border-color: #FF8B94; }
#game-container .cell:nth-child(16n+14) { border-color: #74B9FF; }
#game-container .cell:nth-child(16n+15) { border-color: #A29BFE; }
#game-container .cell:nth-child(16n+16) { border-color: #55EFC4; }



/* all pełny ekran */
@media (max-width: 1290px) {
    #game-container {
        width: 100vw;
        height: 70vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 5px;
        aspect-ratio: auto !important;
    }

    h1 {
        margin-bottom: 10px;
        font-size: 1em;
    }

    .cell {
        border-radius: 5px;
    }
}

@media (max-width: 779px) {
    .wzorzec {
        width: 2rem;
    }

    .btn {
        padding: 4px 4px !important;
        font-size: 0.8rem !important;
        margin: 0 2px !important;
    }
}

.cell img {
    width: 85%;
    height: 85%;
    object-fit: cover;
    pointer-events: none;
    /* ważne – by kliknięcie działało na komórkę, nie obraz */
    filter: contrast(1.3) brightness(1);
    filter: drop-shadow(-3px -3px 3px #53535360);
}

.cell.found {
    background: #d4edda;
    color: #155724;
}

.cell.active {
    background: #fff3cd;
    border: 1px solid red;
    /* jasnożółte tło */
    /* box-shadow: 0 0 8px rgba(255, 200, 0, 0.4); */
    /* delikatne świecenie */
}

.message {
    position: absolute;
    left: auto;
    right: auto;
    margin: auto;
    margin-top: 20px;
    padding: 10px;
    width: fit-content;
    background: #d1ecf1;
    border-radius: 5px;
    display: none;
    z-index: 888;
}


/**** puzzle ******/
.globalContent {
    position: relative;
}

.mainGame {
    position: relative;
    background-color: #fff;
    background: #fff;
}

.puzzleGame {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: -1;
}

.puzzle-xl {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    background: #fff;
}

#pojemnikGra {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0px;
    /*padding: 10px;*/
    background: #eee;
    margin: 10px auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 100vh;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    cursor: crosshair;
}

.zdobyty-kawalek {
    display: none;
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    top: 40%;
    text-align: center;
    width: 330px;
    height: 330px;
    z-index: 200;
    padding: 15px;
    background-color: #f9f9f9;
    background: #d7d7d7;
    border-radius: 10px;
    -webkit-box-shadow: 0px 3px 46px 21px rgba(66, 68, 90, 1);
    -moz-box-shadow: 0px 3px 46px 21px rgba(66, 68, 90, 1);
    box-shadow: 0px 3px 46px 21px rgba(66, 68, 90, 1);
}

.zdobyty-kawalek img {
    width: 300px;
    max-height: 300px;
}

.piece {
    transition: transform 0.2s, opacity 0.3s;
}

.piece:hover {
    transform: scale(1.01);
}

.shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: #ddd;
    min-height: 100px;
    text-align: center;
}

.shelf-piece {
    cursor: pointer;
    border: 2px solid #ccc;
    border-radius: 4px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.shelf-piece:hover {
    border-color: #007bff;
}

.dragging {
    opacity: 0.7;
    transform: scale(1.05);
}

.shelf-piece {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/************************************************** modal ***********************************************/
.modal-dialog{
    opacity: 0.9 !important;

}
.modal-content {
    width: 95%;
    margin: 0 auto;  
}

.modal-body {
    padding: 0;
    object-fit: cover;
    -webkit-box-shadow: 0px 0px 12px 11px rgba(78, 190, 60, 1);
    -moz-box-shadow: 0px 0px 12px 11px rgba(78, 190, 60, 1);
    box-shadow: 0px 0px 12px 11px rgba(77, 190, 60, 0.523);
    border: 6px solid #ffffff;
    border-radius: 1em;
}


.modal-body>img {
    width: auto;
    max-width: 30%;
    max-height: 300px;
    border-radius: 4px;
    opacity: 1;
}

.modal-backdrop {
    opacity: 0 !important;
}

.spinner-border {
    vertical-align: middle !important;
}