/* === Additions/Modifications for Dragging === */

/* Style for the element being dragged */
input.letter-box.dragging {
    opacity: 0.5;
    cursor: grabbing; /* Indicate dragging */
}

/* Style for a potential drop target */
input.letter-box.drag-over {
    border-style: dashed; /* Highlight potential drop zone */
    border-color: #007bff;
}

/* Make non-draggable boxes visually distinct (optional but good UX) */
input.letter-box:not([draggable="true"]) {
    cursor: default; /* No grab cursor if not draggable */
}


/* === Existing Styles (Unchanged) === */

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f4f4f4;
}

h1 {
    color: #333;
}

.input-area {
    margin-bottom: 30px;
}

label {
    margin-right: 10px;
    font-weight: bold;
}

input[type="text"]#letterInput {
    padding: 8px;
    font-size: 1.1em;
    min-width: 200px;
    text-transform: uppercase;
}

#circleContainer {
    position: relative;
    width: 250px;
    height: 250px;
    border: 3px dotted #ccc;
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle-letter {
    position: absolute;
    font-size: 1.8em;
    font-weight: bold;
    color: #555;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    transform-origin: center center;
    user-select: none;
}

#boxContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 20px;
    max-width: 80%;
    /* Add some padding to make dropping at ends easier */
    padding: 5px;
}

input.letter-box {
    border: 2px solid #666;
    background-color: #fff;
    padding: 10px 0;
    margin: 5px;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    width: 40px;
    height: 40px;
    text-align: center;
    text-transform: uppercase;
    box-sizing: border-box;
    cursor: grab; /* Default cursor for draggable items */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.2s ease;
    user-select: none;
}


input.letter-box:focus {
    outline: 2px solid #007bff;
    cursor: text; /* Normal text cursor when focused */
}

input.letter-box.locked {
    background-color: #555;
    color: #fff;
    border-color: #333;
    cursor: default; /* Locked is not draggable */
}

input.letter-box:read-only {
    background-color: #555;
    color: #fff;
    border-color: #333;
    cursor: default; /* Consistent cursor for locked/readonly */
}


input.letter-box.invalid {
    border-color: #dc3545;
    background-color: #f8d7da;
}
input.letter-box.invalid:read-only {
     background-color: #e798a1;
     color: #333;
     border-color: #dc3545;
}


.button-container {
    margin-top: 15px;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    margin: 0 5px;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#resetButton {
    background-color: #6c757d;
}
#resetButton:hover {
    background-color: #5a6268;
}
