:root {
    --bg: #fff9c4;
    --pink: #ff4081;
    --blue: #29b6f6;
    --yellow: #ffee58;
    --green: #66bb6a;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
}

.game-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 40px;
    box-sizing: border-box;
    z-index: 4000;
    background: white;
}

.btn-home, .btn-restart {
    width: 80px;
    height: 80px;
    background: white;
    border: 4px solid var(--blue);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-home img, .btn-restart img { width: 70%; height: 70%; }

.score-display { font-size: 2.5rem; font-weight: 900; color: #ff9800; }

#game-area {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
    box-sizing: border-box;
}

.overlay-modal {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.modal-content h2 { font-size: 3rem; color: var(--blue); }

.btn-start {
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    cursor: pointer;
    margin: 0 auto;
}

.btn-start img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.puzzle-board {
    background: white;
    padding: 10px;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible; /* Aby bylo možné tahat dílky mimo */
}

#puzzle-svg {
    border-radius: 15px;
    background-color: #f0f0f0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    touch-action: none; /* Důležité pro mobily */
    overflow: visible;
}

.piece {
    cursor: grab;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.3));
    transition: filter 0.1s;
}

.piece:active {
    cursor: grabbing;
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.4));
}

.hint-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-overlay img {
    max-width: 85%;
    max-height: 85%;
    border: 10px solid white;
    border-radius: 20px;
}

.ui-btn-large {
    width: 90px;
    height: 90px;
    border-radius: 25px;
    background: white;
    border: 4px solid var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
