/**
 * CheeseClue - Game Board Styles
 * Styles for game grid, boxes, and game-specific elements
 */

/* Guess Rows Container */
#guess-rows {
    max-width: 100%;
    margin: 0 auto 2rem auto;
    padding: 0 10px;
}

.guess-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.guess-row.has-clue {
    margin-bottom: 1.5rem;
}

.guess-row.has-clue .clue {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e9ecef;
}

/* Row Content */
.row-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-size, 6px);
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    width: 100%;
    min-height: calc(var(--box-size, 50px) + 10px);
    padding: 5px 0;
}

.row-content.wrapped {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    line-height: 1.2;
}

/* Word Groups */
.word-group {
    display: flex;
    align-items: center;
    gap: var(--gap-size, 6px);
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* Game Boxes */
.box {
    width: var(--box-size, 50px);
    height: var(--box-size, 50px);
    background-color: #e9ecef;
    border: 2px solid #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--font-size, 1.5rem);
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-radius: 6px;
    color: #495057;
    flex-shrink: 0;
}

.box.filled {
    background-color: #ffffff;
    color: #212529;
    border-color: #6c757d;
}

.box.active {
    background-color: #fff3cd;
    border-color: #ffc107;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.4);
    z-index: 2;
    position: relative;
}

.box.correct {
    background-color: #28a745;
    color: #ffffff;
    border-color: #28a745;
}

.box.present {
    background-color: #ffc107;
    color: #ffffff;
    border-color: #ffc107;
}

.box.absent {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

/* Word Separators */
.word-spacer {
    width: var(--spacer-width, 20px);
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #495057;
    font-size: calc(var(--font-size, 1.5rem) * 1.2);
    flex-shrink: 0;
    flex-basis: 100%;
    width: 100%;
}

.hyphen-separator {
    width: var(--spacer-width, 20px);
    height: var(--box-size, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #495057;
    font-size: calc(var(--font-size, 1.5rem) * 1.4);
    flex-shrink: 0;
}

/* Clues */
.clue {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.4s ease;
    margin-top: 0.5rem;
    max-width: 500px;
    line-height: 1.4;
}

.clue:not(:empty) {
    opacity: 1;
}

/* Enhanced wrapping support */
.row-content.wrapped {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.row-content.wrapped .word-group {
    justify-content: center;
    flex-wrap: nowrap;
}

/* Ensure word groups in wrapped mode don't break */
.row-content.wrapped .word-group {
    display: flex;
    align-items: center;
    gap: var(--gap-size, 6px);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Adjust spacing for wrapped rows */
.guess-row.has-clue.wrapped {
    margin-bottom: 2rem;
}

/* Mobile adjustments for wrapped content */
@media (max-width: 767px) {
    .row-content.wrapped {
        gap: 6px;
    }

    .row-content.wrapped .word-group {
        gap: 4px;
    }
}