.preflop-grid .col {
    min-height: 42px;
    font-size: 0.75rem;
    padding: 0.35rem 0.2rem;
    width: 100%;
}

.preflop-grid button.col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preflop-grid .col.empty-cell {
    visibility: hidden;
}

.chart-panel img {
    max-height: 480px;
    width: 100%;
    object-fit: contain;
    background: #232f42;
}

.table-outline th,
.table-outline td {
    border: 1px solid #3d4f6a;
    padding: 10px;
}

.table-outline thead th {
    border-bottom: 2px solid #3d4f6a;
}

.table-outline .disabled {
    background-color: #232f42;
    opacity: 0.5;
}

.table .grid-item {
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.frequency-content table {
    width: 100%;
}

.frequency-content {
    overflow-x: auto;
}

.matrix-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    grid-template-rows: repeat(13, minmax(0, 1fr));
    gap: 2px;
    width: min(100%, 40rem);
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    font-size: clamp(0.5rem, 1.45vw, 0.72rem);
    user-select: none;
    border-collapse: unset;
    border-spacing: 0;
}

.matrix-grid tbody,
.matrix-grid tr {
    display: contents;
}

.matrix-grid--paintable {
    touch-action: none;
}

.matrix-grid-wrap.is-painting,
.matrix-grid-wrap.is-painting .matrix-cell {
    cursor: crosshair;
}

.matrix-grid td,
.matrix-cell {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    text-align: center;
    vertical-align: middle;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.matrix-cell {
    cursor: pointer;
    position: relative;
    font-weight: 700;
    line-height: 1.1;
    color: #1a1a1a;
    transition: box-shadow 0.08s ease;
}

.matrix-cell.is-suited {
    background: #f3d7b0;
}

.matrix-cell.is-offsuit,
.matrix-cell.is-pair {
    background: #f7f7f7;
}

.matrix-cell__label {
    display: block;
    pointer-events: none;
}

.matrix-cell__freq {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    line-height: 1;
    margin-top: 1px;
    opacity: 0.9;
    pointer-events: none;
}

.matrix-cell__count {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 0.55em;
    font-weight: 600;
    opacity: 0.55;
    pointer-events: none;
}

.matrix-cell.is-active .matrix-cell__count {
    opacity: 0.75;
}

.matrix-cell:hover {
    box-shadow: inset 0 0 0 2px #7ec27a;
}

.matrix-legend span {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.preflop-grid .col.active-spot {
    outline: 3px solid #0d6efd;
    outline-offset: -1px;
}

.inline-create-panel .matrix-grid {
    width: min(100%, 28rem);
    max-width: 100%;
    font-size: 0.55rem;
}

.inline-create-panel .matrix-cell__count {
    display: none;
}

.inline-editor-controls {
    font-size: 0.85rem;
}

.matrix-cell-selected {
    outline: 3px solid #0d6efd;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

@media (max-width: 576px) {
    .matrix-cell__count {
        display: none;
    }
}
