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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: "Space Mono", monospace, serif;
    font-weight: 400;
    background-color: #eee5e9;
    color: #333;
    line-height: 1.1;
    overflow: hidden;
}

#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60vw;
    max-width: 800px;
    /* Ensure container doesn't interfere with absolute pool items */
    z-index: 0;
    pointer-events: none;
    /* Let clicks pass through to pool if needed, re-enable on children */
}

#container>* {
    pointer-events: auto;
}

#pool {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    /*so that draggables don't get stuck beneath the dropzones*/
    pointer-events: none;
}

#title {
    text-align: center;
    padding: 2vh 0 1.5vh 0;
    margin: 0 auto;
}

.row {
    width: 100%;
    margin: 1vw;
    padding: 1vw;
    background-color: #f2f2f2;
    border-radius: 15px;
    align-items: stretch;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2vw;
    position: relative;
    width: 50vw;
    max-width: 800px;
    aspect-ratio: 1/1;
}

.zone {
    padding: 0.25vw;
    background-color: #f2f2f2;
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #333;
    position: relative;
}

.dropzone {
    width: 100%;
    height: 100%;
    background: #f0f8ff80;
    border: 2px dashed #fff;
    display: flex;
    flex-wrap: wrap;
    /* Allows items to stack nicely when dropped */
    align-content: flex-start;
    padding: 25px 5px 5px 5px;
    /* Top padding clears the label title */
    border-radius: 1rem;
    z-index: 2;
    transition: background-color 0.3s;
}

.dropzone.data {
    background-color: #b3efb27c;
    width: 100%;
    height: 100%;
}

.dropzone.question {
    background-color: #3083dc73;
    width: 100%;
    height: 100%;
}

.dropzone.rules {
    background: #fbffad84;
}

/* Feedback class added by Interact.js logic */
.drop-active {
    border-color: #66ccff !important;
    background-color: #cc8 !important;
}

.drop-target {
    background-color: #cceeff !important;
    border-color: #0066cc !important;
    border-style: solid !important;
}

.drop-target-invalid {
    background-color: #cc2937d2 !important;
    color: #fff;
    border-color: #ffffff;
    border-style: 2px dashed #fff;
}

.dz-title {
    position: absolute;
    text-align: center;
    top: 5%;
    z-index: 1;
    font-weight: bold;
    pointer-events: none;
}

.draggable {
    width: 7vw;
    height: 7vw;
    background: #FBFFAD;
    border: 1px solid #FBFFAD;
    border-radius: 10%;
    margin: 3px;
    padding: 5px;
    text-align: center;

    /* Interact.js Requirements */
    touch-action: none;
    user-select: none;
    position: absolute;
    /* Default state in pool */

    cursor: grab;
    font-size: 0.9rem;
    box-shadow: 0 0 16px rgba(33, 33, 33, 0.1);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;

    /*fix for draggables getting stuck inside dropzones*/
    pointer-events: auto;
}

.draggable-invalid {
    opacity: 0.25;
}

.draggable:active {
    cursor: grabbing;
}

.draggable.data {
    background: #b3efb2;
    font-size: large;
}

.draggable.rules {
    background-color: #faf2f2;
    font-size: x-small;
}

.draggable.question {
    background-color: #3083dc;
    color: #eee5e9
}

/* When inside a dropzone, we remove absolute positioning */
.draggable.fixed {
    position: static;
    transform: none;
    width: auto;
    min-width: 60px;
    height: auto;
    min-height: 40px;
    margin: 5px;
    z-index: 10;
    border-radius: 5px;
    font-size: large;
}

/* When a draggable is dropped into the Data dropzone, let it fill the zone */
.dropzone.data .draggable.fixed {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 6%;
    color: #fff;
    background: #269524a1;
    box-sizing: border-box;
    box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.9);
    font-size: x-large;
}

/* When a draggable is dropped into the Data dropzone, let it fill the zone */
.dropzone.question .draggable.fixed {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6%;
    background-color: #124984a5;
    box-sizing: border-box;
    box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.9);
    font-size: x-large;
}

#submit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15vw;
    height: 15vw;
    max-width: 150px;
    max-height: 150px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    z-index: 100;
    box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.2);
    font-family: monospace, sans-serif;
    font-size: large;
    color: #333;
    cursor: pointer;
}

#submit:hover {
    background-color: rgba(255, 255, 255, 1);
    color: #818181;
}

textarea {
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
}