.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
}

.game-header {
    margin-bottom: 2rem;
}

.game-controls-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-2);
}

.game-board {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.word-grid {
    display: grid;
    gap: 4px;
    user-select: none;
    touch-action: none;
    margin: 0 auto;
    background: var(--surface-2);
    padding: 8px;
    border-radius: 12px;
}

.grid-cell {
    width: 40px; 
    height: 40px; 
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    background: var(--surface-1);
    border-radius: 8px;
    /* border: 2px solid var(--surface-3); */
    transition: all 0.1s ease;
    color: var(--text-1);
    position: relative;
    z-index: 10;
}

.grid-cell.block {
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.grid-cell.selected {
    background: var(--color-primary);
    color: white;
    transform: scale(1.05);
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.grid-cell.found {
    background: var(--color-secondary);
    color: white;
    /* border-color: var(--color-secondary); */
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Snake Connectors */
/* Using pseudo elements to bridge the gap */
.grid-cell.connect-e::after {
    content: ''; position: absolute; right: -8px; top: 20%; bottom: 20%; width: 10px; background: inherit; z-index: -1;
}
.grid-cell.connect-w::after {
    content: ''; position: absolute; left: -8px; top: 20%; bottom: 20%; width: 10px; background: inherit; z-index: -1;
}
.grid-cell.connect-n::after {
    content: ''; position: absolute; top: -8px; left: 20%; right: 20%; height: 10px; background: inherit; z-index: -1;
}
.grid-cell.connect-s::after {
    content: ''; position: absolute; bottom: -8px; left: 20%; right: 20%; height: 10px; background: inherit; z-index: -1;
}
/* Diagonals are harder with simple blocks, skip visual bridge for diagonals for now or use rotation */
/* Just let them look like floating islands if diagonal */

.found-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    min-width: 250px;
    max-width: 300px;
}

.clue-item {
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--surface-3);
    font-size: 0.9rem;
    color: var(--text-2);
    transition: all 0.2s;
}
.clue-item.found {
    background: var(--color-secondary-dim);
    border-color: var(--color-secondary);
    color: var(--text-1);
}

.theme-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-2);
    border-radius: 12px;
    animation: slideUp 0.5s ease;
}

.input-area {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
    justify-content: center;
}

.view-section.hidden { display: none; }
.feedback.hidden { opacity: 0; pointer-events: none; }
.feedback {
    margin-top: 1rem;
    font-weight: 600;
    transition: opacity 0.3s;
}
.feedback.success { color: var(--color-success); }
.feedback.error { color: var(--color-error); }

@media (max-width: 600px) {
    .game-board {
        flex-direction: column;
        align-items: center;
    }
    .found-words {
        width: 100%;
        max-width: 100%;
    }
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
