#board {
    width: 90vw;
    /* 最大占屏幕宽度的 90% */
    max-width: 400px;
    /* 桌面端限制最大宽度 */
    aspect-ratio: 1 / 1;
    /* 保持正方形 */
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    background: #bbada0;
    padding: 5px;
    border-radius: 5px;
    touch-action: none;
}

.cell {
    width: 100%;
    /* 自适应父元素格子大小 */
    aspect-ratio: 1 / 1;
    /* 保持正方形 */
    background: #cdc1b4;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    transition: transform 0.2s ease;
    /* 添加动画过渡 */
}

#legend {
    display: flex;
    flex-wrap: wrap;
    /* 超出自动换行 */
    justify-content: center;
    gap: 5px;
    margin: 15px auto 0 auto;
    width: 90vw;
    /* 与棋盘宽度一致 */
    max-width: 400px;
}

#legend .cell {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
}

.leaderboard-entry {
    text-align: center;
    color: white;
    margin-bottom: 2px;
    font-size: 14px;
}

@media (max-width: 500px) {
    #legend .cell {
        width: 40px;
        height: 40px;
    }
}
