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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1em;
    color: #666;
}

.stats span {
    font-weight: bold;
}

#game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-height: 400px;
}

.workbench {
    background: #f4e4c1;
    border: 4px solid #8b4513;
    border-radius: 8px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    min-height: 200px;
}

.spot {
    background: rgba(139, 69, 19, 0.1);
    border: 3px dashed #8b4513;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100px;
    position: relative;
    transition: all 0.2s;
}

.spot.drag-over {
    background: rgba(139, 69, 19, 0.3);
    border-color: #ff6b6b;
    transform: scale(1.05);
}

.spot.filled {
    border-style: solid;
    background: rgba(76, 175, 80, 0.2);
}

.spot-label {
    font-weight: bold;
    color: #8b4513;
    text-align: center;
    font-size: 0.9em;
    text-transform: uppercase;
}

.messy-pile {
    background: #f9f9f9;
    border: 3px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.part {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: grab;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    text-align: center;
}

.part:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.part.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.part.in-spot {
    cursor: default;
}

.touch-drag-clone {
    transition: none !important;
}

.message {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 30px;
    margin-top: 20px;
    animation: fadeIn 0.3s;
}

.message.success {
    color: #4caf50;
}

.message.error {
    color: #ff6b6b;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    animation: slideIn 0.3s;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    color: #666;
    margin: 10px 0;
    font-size: 1.2em;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Courier New', monospace;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.3s;
}
