/* styles.css */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background-color: #757575;
    margin: 0;
    padding: 0;
}

h1 {
    background-color: #676767;
    ;
    color: white;
    padding: 20px 0;
    margin: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#initial-image {
    margin: 20px 0;
}

#welcome-image {
    width: 600px;
    /* Adjust size as needed */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.shadow-cell {
    position: absolute;
    z-index: 500;
    opacity: 0.8;
    pointer-events: none;
}


#welcome-image:hover {
    transform: scale(1.05);
}

#initial-view,
#game-view {
    margin: 20px auto;
}

button {
    padding: 15px 30px;
    margin: 10px;
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff;
    /* Белый текст */
    background: linear-gradient(45deg, #4CAF50, #81C784);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.19);
    /* Тень */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.22);
    background: linear-gradient(45deg, #45a049, #66BB6A);
}

button:active {
    transform: scale(0.98);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.22);
}

#leaderboard-button {
    background: linear-gradient(45deg, #2196F3, #64B5F6);
}

#leaderboard-button:hover {
    background: linear-gradient(45deg, #0b7dda, #42A5F5);
}

#restart-button {
    background: linear-gradient(45deg, #f44336, #e57373);
}

#restart-button:hover {
    background: linear-gradient(45deg, #da190b, #ef5350);
}

#back-button {
    background: linear-gradient(45deg, #9C27B0, #BA68C8);
}

#back-button:hover {
    background: linear-gradient(45deg, #7B1FA2, #AB47BC);
}

#back-home-button {
    background: linear-gradient(45deg, #FF9800, #FFB74D);
    color: #fff;
    font-weight: bold;
}

#back-home-button:hover {
    background: linear-gradient(45deg, #FB8C00, #FFA726);
}


.game-buttons {
    margin-top: 20px;
}

#puzzle-container {
    position: relative;
    width: 800px;
    /* Matches containerSize in script.js */
    height: 800px;
    margin: 20px auto;
    border: 3px solid #333;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.puzzle-piece {
    position: absolute;
    background-repeat: no-repeat;
    cursor: grab;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dragging {
    opacity: 0.5;
}

#timer {
    font-size: 1.5em;
    margin-top: 10px;
    color: #333;
}

#timer.warning {
    color: #e53935;
    /* Red color for warning */
    font-weight: bold;
}

#message {
    margin-top: 20px;
    font-size: 1.3em;
    color: #4CAF50;
}

#nft-message {
    font-weight: bold;
}

#leaderboard {
    width: 80%;
    max-width: 800px;
    margin: 40px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#leaderboard h2 {
    margin-top: 0;
    color: #333;
}

#leaderboard table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
}

#leaderboard th,
#leaderboard td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 1em;
}

#leaderboard tr:nth-child(even) {
    background-color: #f2f2f2;
}

#leaderboard th {
    background-color: #4CAF50;
    color: white;
}

canvas#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
}

#game-instructions {
    margin-top: 40px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 1.2em;
    line-height: 1.6;
}

#game-instructions h2 {
    margin-bottom: 15px;
    font-size: 1.8em;
    color: #ff9800;
}

#game-instructions p {
    margin-bottom: 10px;
}

#game-instructions a {
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s ease;
}

#game-instructions a:hover {
    color: #ff9800;
}

@media (max-width: 768px) {
    #game-instructions {
        font-size: 1em;
        padding: 15px;
        line-height: 1.4;
        margin: 20px;
    }

    #game-instructions h2 {
        font-size: 1.5em;
    }

    #game-instructions p {
        font-size: 0.9em;
    }

    #game-instructions a {
        font-size: 1em;
    }
}

/* Responsive Design for Mobile Devices */
@media (max-width: 700px) {
    #puzzle-container {
        width: 100%;
        height: 100vw;
        /* Maintains aspect ratio */
    }

    #welcome-image {
        width: 200px;
    }

    button {
        padding: 10px 20px;
        margin: 5px;
        font-size: 0.9em;
    }

    .game-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #leaderboard {
        width: 95%;
    }

    #game-instructions {
        font-size: 1em;
        padding: 15px;
        line-height: 1.4;
        margin: 20px;
    }

    #game-instructions h2 {
        font-size: 1.5em;
    }

    #game-instructions p {
        font-size: 0.9em;
    }

    #game-instructions a {
        font-size: 1em;
    }
}