.scrabble-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    width: 100%;
    max-width: 670px;
    margin: 0 auto;
    border-radius: 8px;
    background: #eaeaea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.scrabble-cell {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 500;
    color: #222;
    border: 1px solid #e0e0e0;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
}
.scrabble-cell:not(:empty) {
    background: #f5f5f5;
    color: #222;
    font-weight: 700;
}
.tw { background: #a92e2e}
.dw { background: #f6c0c0}
.tl { background: #3b88ca}
.dl { background: #b9e7f5}
.center { background: #b9e7f5}
.board-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.5rem 1rem 1rem 1rem;
    margin-bottom: 1.5rem;
    height: 100%;
}
.board-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #888;
}
.legend-tile {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}
.moves-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.5rem 1rem 1rem 1rem;
    margin-bottom: 1.5rem;
    height: 100%;
}
.moves-header {
    background: none;
    color: #222;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}
.final-result {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
}
.moves-table {
    background: none;
    border-radius: 0;
}
.moves-table thead th {
    background: none;
    border: none;
    color: #888;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.3rem;
}
.moves-table tbody tr {
    transition: background 0.2s;
    border-bottom: 1px solid #f2f2f2;
    cursor: pointer;
}

.moves-table tbody tr td.active {
    background: #dee2e6;
}
.moves-table td {
    padding: 0.5rem 0.3rem;
    vertical-align: middle;
    border: none;
    font-size: 0.95rem;
}
.move-number {
    background: #f5f5f5;
    color: #888;
    border-radius: 50%;
    width: 1.7rem;
    height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.move-start-field, .move-rack {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}
.move-words {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.4;
}
.table-stats {
    background: none;
    border-top: 1px solid #eee;
    padding: 0.7rem 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
}
.stats-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.stats-value {
    font-weight: 600;
    color: #444;
}
.scrabble-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #000000;
    color: #fff3cd;
    font-weight: 700;
    font-size: 2rem;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    z-index: 2;
    position: absolute;
    top: 0; left: 0;
}

.scrabble-tile sub {
    font-size: 0.5rem;
}

@media (max-width: 991.98px) {
    .row.flex-lg-row {
        flex-direction: column !important;
    }
    .col-7, .col-5 {
        max-width: 100%;
        flex: 0 0 100%;
    }
    .board-container, .moves-container {
        margin-bottom: 1.2rem;
    }
}
@media (max-width: 600px) {
    .scrabble-board {
        max-width: 100vw;
    }
    .scrabble-cell {
        font-size: 0.8rem;
    }
    .board-container, .moves-container {
        padding: 1rem 0.3rem;
    }
}
