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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 95%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
}

.game-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

button, select {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button {
    background-color: #4CAF50;
    color: white;
}

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

select {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

.file-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
    cursor: pointer;
}

#timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
}

.game-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

#puzzleBoard {
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

#piecesContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    width: 300px;
    margin: 0 auto;
}

.puzzle-slot {
    position: absolute;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    background-color: rgba(200, 200, 200, 0.05);
    width: 33.333%;
    height: 33.333%;
    box-sizing: border-box;
}

.puzzle-piece {
    cursor: grab;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    transition: transform 0.2s;
    user-select: none;
    -webkit-user-drag: element;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    background-size: 300% 300%;
    touch-action: none;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    z-index: 3;
}

.puzzle-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

#dragging-clone {
    pointer-events: none;
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 100px !important;
    height: 100px !important;
    position: fixed;
    z-index: 1000;
    background-size: 300% 300% !important;
}

.puzzle-piece.placed {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    top: 0;
    left: 0;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    #puzzleBoard, #piecesContainer {
        width: 100%;
        max-width: 300px;
    }

    #puzzleBoard {
        height: 300px;
    }

    .puzzle-piece {
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }
} 