/* Basic layout */
body {
    font-family: Arial, sans-serif;
    margin: 0px;
    padding: 20px;
    background: #f7f7f7;
    color: #333;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

/* Setup section */
#setup {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Message area */
#message {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    min-height: 30px; /* keeps layout stable */
}

/* Game area container */
#game {
    width: 100%;
    margin: 0;
    padding: 20px;
    border: 2px solid #ccc;
    background: white;
    border-radius: 8px;
}

/* Ordered row: clean horizontal layout */
#orderedRow {
    display: flex;
    flex-wrap: wrap;        /* allow multiple rows */
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}


/* Scramble area: free‑position zone */
#gameArea {
    position: relative;
    width: 100%;
    height: 600px; /* adjust as needed */
    border: 2px dashed #aaa;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden; /* prevents rectangles from spilling out */
}

/* Hide elements when needed */
.hidden {
    display: none;
}



#wrapper {
    width: min(100%, 1500px);
    margin: 0 auto;          /* centers the wrapper */
    display: flex;
    flex-direction: column;
    align-items: center;     /* centers children horizontally */
}

#gameArea { background: pink; }

.rectangle {
    width: 10em;
    height: 5em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    background-color: var(--rect-color);
}


/* static mode (ordered row) */
.rectangle.static {
    position: static;
}

/* absolute mode (scramble area) */
.rectangle.absolute {
    position: absolute;
    left: var(--rect-x);
    top: var(--rect-y);
}

/* scrambled mode */
.rectangle.scrambled {
    color: transparent;
}


