* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    text-align: center;
}

h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    color: white;
    margin-bottom: 20px;
}

.game-info p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.stat-item {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-right: 8px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#resetBtn {
    background-color: #ff9800;
}

#resetBtn:hover {
    background-color: #e68900;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-template-rows: repeat(4, 100px);
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto;
    width: fit-content;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tile {
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tile:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.tile.movable {
    cursor: pointer;
}

.tile.movable:hover {
    background: linear-gradient(145deg, #f0f0f0, #d0d0d0);
}

.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.empty:hover {
    transform: none;
}

.win-message {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.win-message h2 {
    color: #4CAF50;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.win-message p {
    color: #333;
    font-size: 1.2em;
    margin: 5px 0;
}

.new-record {
    color: #ff9800;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 10px;
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .puzzle-grid {
        grid-template-columns: repeat(4, 70px);
        grid-template-rows: repeat(4, 70px);
    }

    .tile {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    h1 {
        font-size: 2em;
    }
}
